-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.d.ts
More file actions
63 lines (58 loc) · 1.69 KB
/
Copy pathtypes.d.ts
File metadata and controls
63 lines (58 loc) · 1.69 KB
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
// Global type declarations for PeerWeb project
// WebTorrent type declarations
declare class WebTorrent {
constructor(opts?: any);
add(
torrentId: string | File | Blob | Buffer,
opts?: any,
callback?: (torrent: any) => void
): any;
seed(
files: File[] | FileList,
opts?: any,
callback?: (torrent: any) => void
): any;
destroy(callback?: (err?: Error) => void): void;
on(event: string, callback: (...args: any[]) => void): void;
torrents: any[];
}
// DOMPurify type declarations
declare const DOMPurify: {
sanitize(
dirty: string | Node,
config?: {
ALLOWED_TAGS?: string[];
ALLOWED_ATTR?: string[];
ALLOWED_URI_REGEXP?: RegExp;
RETURN_DOM?: boolean;
RETURN_DOM_FRAGMENT?: boolean;
RETURN_DOM_IMPORT?: boolean;
SAFE_FOR_TEMPLATES?: boolean;
WHOLE_DOCUMENT?: boolean;
FORCE_BODY?: boolean;
SANITIZE_DOM?: boolean;
KEEP_CONTENT?: boolean;
IN_PLACE?: boolean;
USE_PROFILES?: any;
FORBID_CONTENTS?: string[];
FORBID_TAGS?: string[];
FORBID_ATTR?: string[];
ALLOW_DATA_ATTR?: boolean;
ALLOW_UNKNOWN_PROTOCOLS?: boolean;
CUSTOM_ELEMENT_HANDLING?: any;
}
): string;
isSupported: boolean;
};
// Extend Window interface
interface Window {
peerWeb?: any;
WebTorrent?: typeof WebTorrent;
DOMPurify?: typeof DOMPurify;
}
// Service Worker types
interface ServiceWorkerGlobalScope {
skipWaiting(): Promise<void>;
clients: Clients;
}
declare var self: ServiceWorkerGlobalScope;