Skip to content

Commit fdd6fea

Browse files
committed
remove unnecessary global typings from canvas and sync global typings in xpack with oss
1 parent c952d22 commit fdd6fea

4 files changed

Lines changed: 38 additions & 15 deletions

File tree

examples/alerting_example/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "./target",
5-
"skipLibCheck": true,
6-
"resolveJsonModule": true
4+
"outDir": "./target"
75
},
86
"include": [
97
"index.ts",

typings/index.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ declare module '*.html' {
2323
export default template;
2424
}
2525

26+
declare module '*.png' {
27+
const content: string;
28+
// eslint-disable-next-line import/no-default-export
29+
export default content;
30+
}
31+
32+
declare module '*.svg' {
33+
const content: string;
34+
// eslint-disable-next-line import/no-default-export
35+
export default content;
36+
}
37+
38+
// allow JSON files to be imported directly without lint errors
39+
// see: https://github.com/palantir/tslint/issues/1264#issuecomment-228433367
40+
// and: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts
41+
declare module '*.json' {
42+
const json: any;
43+
// eslint-disable-next-line import/no-default-export
44+
export default json;
45+
}
46+
2647
type MethodKeysOf<T> = {
2748
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
2849
}[keyof T];
@@ -37,3 +58,7 @@ type DeeplyMockedKeys<T> = {
3758
: DeeplyMockedKeys<T[P]>;
3859
} &
3960
T;
61+
62+
type Writable<T> = {
63+
-readonly [K in keyof T]: T[K];
64+
};

x-pack/legacy/plugins/canvas/types/webpack.d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

x-pack/typings/index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ declare module '*.html' {
1010
export default template;
1111
}
1212

13+
declare module '*.png' {
14+
const content: string;
15+
// eslint-disable-next-line import/no-default-export
16+
export default content;
17+
}
18+
19+
declare module '*.svg' {
20+
const content: string;
21+
// eslint-disable-next-line import/no-default-export
22+
export default content;
23+
}
24+
1325
declare module 'lodash/internal/toPath' {
1426
function toPath(value: string | string[]): string[];
1527
export = toPath;

0 commit comments

Comments
 (0)