-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.d.ts
64 lines (55 loc) · 1.6 KB
/
globals.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* eslint-disable @typescript-eslint/no-explicit-any */
// Tell Typescript that SASS imports are okay as they're handled by bundler
declare module '*.scss' {
export const styles: string;
export default styles;
}
declare module '*.css' {
export const styles: string;
export default styles;
}
declare module '*.svg' {
export const content: string;
export default content;
}
declare module 'lit-code' {
import type { LitElement } from 'lit';
export declare global {
HTMLElementTagNameMap['lit-code'] = LitCode;
}
export class LitCode extends LitElement {
elContainer: HTMLElement;
elTextarea: HTMLTextAreaElement;
linenumbers: boolean;
noshadow: boolean;
mycolors: boolean;
code: string;
language: string;
grammar: string;
_getElement<T extends HTMLElement = HTMLElement>(id: string): T;
getCode(): string;
setCode(code: string): void;
}
}
declare module 'mocha' {
declare global {
type EachFunc = (this: Context, params: Record<string, any>, done: Done) => void;
type EachAsyncFunc = (this: Context, params: Record<string, any>) => PromiseLike<any>;
namespace Mocha {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface TestFunction {
each(
strings: TemplateStringsArray,
...placeholders: any[]
): {
(fn: EachFunc): Test;
(fn: EachAsyncFunc): Test;
(title: string, fn?: EachFunc): Test;
(title: string, fn?: EachAsyncFunc): Test;
};
}
}
// eslint-disable-next-line no-var
declare var it: Mocha.TestFunction;
}
}