kibana/x-pack/typings/index.d.ts

38 lines
1.1 KiB
TypeScript
Raw Normal View History

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
declare module '*.html' {
const template: string;
// eslint-disable-next-line import/no-default-export
export default template;
}
[7.x] [Core] Rewrite saved objects in typescript (#36829) (#38249) * [Core] Rewrite saved objects in typescript (#36829) * Convert simple files to TS * Fix jest tests * Rename saved_objects_client{.js => .ts} * WIP saved_objects_client * saved_objects repository{.js => .ts} * includedFields support string[] for type paramater * Repository/saved_objects_client -> TS * Fix tests and dependencies * Fix saved objects type errors and simplify * saved_objects/index saved_objects/service/index -> ts * Fix saved objects export test after switching to typed mock * Workaround type error * Revert "Workaround type error" This reverts commit de3252267eb2e6bf56a5584d271b55a7afdc1c53. * Correctly type Server.savedObjects.SaveObjectsClient constructor * saved_objects/service/lib/index.{js -> ts} * saved_objects/service/lib/scoped_client_provider{js -> ts} * Typescriptify scoped_client_provider * Fix x-pack jest imports * Add lodash/internal/toPath typings to xpath * Introduce SavedObjectsClientContract We need a way to specify that injected dependencies should adhere to the SavedObjectsClient "contract". We can't use the SavedObjectsClient class itself since it contains the private _repository property which in TS is included in the type signature of a class. * Cleanup and simplify types * Fix repository#delete should return {} * Add SavedObjects repository test for uncovered bug Test for a bug in our previous js implementation that can lead to data corruption and data loss. If a bulkGet request is made where one of the objects to fetch is of a type that isn't allowed, the returned result will include documents which have the incorrect id and type assigned. E.g. the data of an object with id '1' is returned with id '2'. Saving '2' will incorrectly override it's data with that of the data of object '1'. * SavedObject.updated_at: string and unify saved_object / serializer types * Cleanup * Address code review feedback * Don't mock errors helpers in SavedObjectsClient Mock * Address CR feedback * CR Feedback #2 * Add kibana-platform as code owners of Saved Objects * Better typings for SavedObjectsClient.errors * Use unknown as default for generic type request paramater * Bump @types/elasticsearch * Fix types for isForbiddenError * Bump x-pack @types/elasticsearch * Update yarn.lock
2019-06-07 17:07:07 +02:00
declare module 'lodash/internal/toPath' {
function toPath(value: string | string[]): string[];
export = toPath;
}
type MethodKeysOf<T> = {
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
[7.x] [Core] Rewrite saved objects in typescript (#36829) (#38249) * [Core] Rewrite saved objects in typescript (#36829) * Convert simple files to TS * Fix jest tests * Rename saved_objects_client{.js => .ts} * WIP saved_objects_client * saved_objects repository{.js => .ts} * includedFields support string[] for type paramater * Repository/saved_objects_client -> TS * Fix tests and dependencies * Fix saved objects type errors and simplify * saved_objects/index saved_objects/service/index -> ts * Fix saved objects export test after switching to typed mock * Workaround type error * Revert "Workaround type error" This reverts commit de3252267eb2e6bf56a5584d271b55a7afdc1c53. * Correctly type Server.savedObjects.SaveObjectsClient constructor * saved_objects/service/lib/index.{js -> ts} * saved_objects/service/lib/scoped_client_provider{js -> ts} * Typescriptify scoped_client_provider * Fix x-pack jest imports * Add lodash/internal/toPath typings to xpath * Introduce SavedObjectsClientContract We need a way to specify that injected dependencies should adhere to the SavedObjectsClient "contract". We can't use the SavedObjectsClient class itself since it contains the private _repository property which in TS is included in the type signature of a class. * Cleanup and simplify types * Fix repository#delete should return {} * Add SavedObjects repository test for uncovered bug Test for a bug in our previous js implementation that can lead to data corruption and data loss. If a bulkGet request is made where one of the objects to fetch is of a type that isn't allowed, the returned result will include documents which have the incorrect id and type assigned. E.g. the data of an object with id '1' is returned with id '2'. Saving '2' will incorrectly override it's data with that of the data of object '1'. * SavedObject.updated_at: string and unify saved_object / serializer types * Cleanup * Address code review feedback * Don't mock errors helpers in SavedObjectsClient Mock * Address CR feedback * CR Feedback #2 * Add kibana-platform as code owners of Saved Objects * Better typings for SavedObjectsClient.errors * Use unknown as default for generic type request paramater * Bump @types/elasticsearch * Fix types for isForbiddenError * Bump x-pack @types/elasticsearch * Update yarn.lock
2019-06-07 17:07:07 +02:00
}[keyof T];
type PublicMethodsOf<T> = Pick<T, MethodKeysOf<T>>;
declare module 'axios/lib/adapters/xhr';
Licensing plugin (#49345) (#51026) * Add x-pack plugin for new platform browser licensing information * Address next round of reviews * Remove poller functionality in favor of inline observables * More observable changes from review comments * Fix outstanding tests * More changes from review, adding additional testing * Add additional tests for license comparisons and sessions * Update test snapshot due to sessionstorage mock * Next round of review feedback from restrry * Fix more review requests from restrry, add additional tests * Pass correct sign mock to license info changed test * Improve doc comments, switch to I-interface pattern * Test error polling sanity, do not expose signature, do not poll on client * Fix type check issues from rebase * Fix build error from rebase * minimize config * move all types to server with consistency with other code * implement License * implement license update & refactor has License changed check * update tests for licensing extending route handler context * implement client side side license plugin * implement server side licensing plugin * remove old code * update testing harness * update types for license status * remove jest-localstorage-mock * fix tests * update license in security * address comments. first pass * error is a part of signature. pass error message to License * move common license types under common folder * rename feature props for BWC and unify name with ILicense * test should work in any timezone * make prettier happy * remove obsolete comment * address Pierre comments * use sha256 for security reasons * use stable stringify to avoid churn
2019-11-19 15:00:43 +01:00
type Writable<T> = {
-readonly [K in keyof T]: T[K];
};
// allow JSON files to be imported directly without lint errors
// see: https://github.com/palantir/tslint/issues/1264#issuecomment-228433367
// and: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts
declare module '*.json' {
const json: any;
// eslint-disable-next-line import/no-default-export
export default json;
}