-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
globals.d.ts
96 lines (80 loc) · 2.59 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// TODO: Drop some definitions when their related bugs are resolved
type AnyObject = Record<string, any>;
type AsyncVoidFunction = () => Promise<void>;
interface FeatureInfo {
name: string;
description: string;
screenshot?: string;
disabled?: string;
}
declare const __featuresList__: string[];
declare const __featuresInfo__: FeatureInfo[];
declare const __featureName__: 'use the __featureName__ variable';
interface Window {
collectFeatures: Map<string, FeatureDetails>;
content: GlobalFetch;
}
// Drop after https://github.com/sindresorhus/p-memoize/issues/9
declare module 'mem' {
function mem<T = VoidFunction>(fn: T, options?: AnyObject): T;
export = mem;
}
declare module 'size-plugin';
// Drop when Firefox adds RegEx lookbehind support https://github.com/sindresorhus/refined-github/pull/1936#discussion_r276515991
declare module 'linkify-urls' {
type Options = {
user: string;
repo: string;
type: string;
baseUrl: string;
attributes: {
rel: string;
class: string;
};
};
function linkifyUrls(input: string, options: Options): DocumentFragment;
export = linkifyUrls;
}
// Drop when Firefox adds RegEx lookbehind support https://github.com/sindresorhus/refined-github/pull/1936#discussion_r276515991
declare module 'linkify-issues' {
type Options = {
user: string;
repo: string;
type: string;
baseUrl: string;
attributes: {
rel: string;
class: string;
};
};
function linkifyIssues(input: string, options: Options): DocumentFragment;
export = linkifyIssues;
}
// Custom UI events specific to RGH
interface GlobalEventHandlersEventMap {
'details:toggled': CustomEvent;
'rgh:view-markdown-source': CustomEvent;
'rgh:view-markdown-rendered': CustomEvent;
'filterable:change': CustomEvent;
}
declare namespace JSX {
interface Element extends SVGElement, HTMLElement, DocumentFragment {}
type BaseIntrinsicElement = IntrinsicElements['div'];
type LabelIntrinsicElement = IntrinsicElements['label'];
interface IntrinsicElements {
'has-rgh': {};
'label': LabelIntrinsicElement & {for?: string};
'include-fragment': BaseIntrinsicElement & {src?: string};
'details-menu': BaseIntrinsicElement & {src?: string; preload?: boolean};
'relative-time': BaseIntrinsicElement & {datetime: string; title: string};
'details-dialog': BaseIntrinsicElement & {tabindex: string};
}
}
// Drop after https://github.com/Microsoft/TypeScript/issues/30928
interface NamedNodeMap {
[key: string]: Attr;
}
// Drop after https://github.com/Microsoft/TypeScript/issues/30928
interface HTMLFormControlsCollection {
[key: string]: HTMLInputElement | HTMLTextAreaElement | HTMLButtonElement;
}