forked from sindresorhus/screenfull
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test-d.ts
42 lines (33 loc) · 1.13 KB
/
index.test-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
import {expectType} from 'tsd';
import screenfull, {RawEventNames} from './index.js';
const element: Element = document.querySelector('#target')!;
expectType<Promise<void>>(screenfull.request());
expectType<Promise<void>>(screenfull.request(element));
expectType<Promise<void>>(screenfull.toggle());
expectType<Promise<void>>(screenfull.toggle(element));
expectType<Promise<void>>(screenfull.exit());
screenfull.on('change', event => {
expectType<Event>(event);
});
screenfull.on('error', event => {
expectType<Event>(event);
});
screenfull.off('change', event => {
expectType<Event>(event);
});
screenfull.off('error', event => {
expectType<Event>(event);
});
screenfull.onchange(event => {
expectType<Event>(event);
});
screenfull.onerror(event => {
expectType<Event>(event);
});
expectType<RawEventNames>(screenfull.raw);
expectType<string>(screenfull.raw.requestFullscreen);
expectType<string>(screenfull.raw.exitFullscreen);
expectType<string>(screenfull.raw.fullscreenElement);
expectType<string>(screenfull.raw.fullscreenEnabled);
expectType<string>(screenfull.raw.fullscreenchange);
expectType<string>(screenfull.raw.fullscreenerror);