native-fn 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -8
- package/dist/index.d.ts +42 -21
- package/dist/native.cjs +412 -110
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +412 -110
- package/dist/native.umd.js +412 -110
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/appearance/index.cjs +16 -18
- package/dist/plugin/appearance/index.d.ts +2 -2
- package/dist/plugin/appearance/index.mjs +17 -19
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/appearance/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/appearance/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/appearance/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/badge/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/badge/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/badge/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/badge/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/badge/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/badge/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/badge/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/battery/index.cjs +4 -6
- package/dist/plugin/battery/index.mjs +4 -6
- package/dist/plugin/battery/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/battery/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/battery/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/battery/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/battery/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/battery/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/battery/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/clipboard/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/clipboard/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/dimension/index.cjs +456 -97
- package/dist/plugin/dimension/index.d.ts +45 -24
- package/dist/plugin/dimension/index.mjs +457 -97
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/dimension/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/dimension/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/dimension/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +9 -11
- package/dist/plugin/fullscreen/index.mjs +9 -11
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/fullscreen/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/fullscreen/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/geolocation/index.cjs +4 -6
- package/dist/plugin/geolocation/index.mjs +4 -6
- package/dist/plugin/geolocation/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/geolocation/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/geolocation/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/geolocation/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/geolocation/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/geolocation/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/geolocation/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/notification/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/notification/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/notification/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/notification/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/notification/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/notification/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/notification/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/open/index.cjs +6 -6
- package/dist/plugin/open/index.d.ts +16 -0
- package/dist/plugin/open/index.mjs +6 -6
- package/dist/plugin/open/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/open/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/open/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/open/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/open/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/open/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/open/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/open/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/permission/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/permission/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/permission/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/permission/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/permission/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/permission/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/permission/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/pip/index.cjs +9 -11
- package/dist/plugin/pip/index.mjs +9 -11
- package/dist/plugin/pip/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/pip/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/pip/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/pip/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/pip/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/pip/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/pip/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +11 -12
- package/dist/plugin/platform/index.d.ts +17 -1
- package/dist/plugin/platform/index.mjs +5 -5
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/platform/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/platform/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/platform/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +5 -5
- package/dist/plugin/theme/index.mjs +5 -5
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/theme/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/theme/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/theme/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/vibration/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/plugin/vibration/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/vibration/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/plugin/vibration/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/vibration/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/vibration/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/vibration/src/utils/insert-sort.d.ts +1 -0
- package/dist/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/src/plugin/dimension/constants/index.d.ts +2 -3
- package/dist/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/src/plugin/dimension/types/dimensions.d.ts +26 -20
- package/dist/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/src/utils/insert-sort.d.ts +1 -0
- package/package.json +1 -1
|
@@ -21,11 +21,11 @@ var Appearances;
|
|
|
21
21
|
Appearances["Light"] = "light";
|
|
22
22
|
Appearances["Dark"] = "dark";
|
|
23
23
|
})(Appearances || (Appearances = {}));
|
|
24
|
-
var
|
|
24
|
+
var PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST;
|
|
25
25
|
if (typeof globalThis.matchMedia !== 'undefined')
|
|
26
|
-
|
|
26
|
+
PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST = globalThis.matchMedia('(prefers-color-scheme: dark)');
|
|
27
27
|
else
|
|
28
|
-
|
|
28
|
+
PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST = FALLBACK_MEDIA_QUERY_LIST;
|
|
29
29
|
var CONTEXT = globalThis.document.createElement('canvas').getContext('2d', { willReadFrequently: true });
|
|
30
30
|
var SVG_PIXEL_DATA_URL = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoMXYxSDB6Ii8+PC9zdmc+';
|
|
31
31
|
|
|
@@ -118,11 +118,11 @@ var Browsers;
|
|
|
118
118
|
Browsers["IE"] = "IE";
|
|
119
119
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
120
120
|
})(Browsers || (Browsers = {}));
|
|
121
|
-
var USER_AGENT
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
var USER_AGENT;
|
|
122
|
+
if (typeof globalThis.navigator.userAgent !== 'undefined')
|
|
123
|
+
USER_AGENT = globalThis.navigator.userAgent;
|
|
124
|
+
else
|
|
125
|
+
USER_AGENT = '';
|
|
126
126
|
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
127
127
|
'Google Chrome': 'Chrome',
|
|
128
128
|
'Microsoft Edge': 'Edge',
|
|
@@ -621,6 +621,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
621
621
|
},
|
|
622
622
|
subscribe: function (listener, options) {
|
|
623
623
|
if (options === void 0) { options = {}; }
|
|
624
|
+
if (typeof options.signal !== 'undefined' && options.signal.aborted)
|
|
625
|
+
return function () { };
|
|
624
626
|
var entry = { fn: listener, once: false };
|
|
625
627
|
if (typeof options.once !== 'undefined')
|
|
626
628
|
entry.once = options.once;
|
|
@@ -639,12 +641,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
639
641
|
EventListener.remove(entry.signal, { type: 'abort', callback: cleanup });
|
|
640
642
|
removeEntry(entry);
|
|
641
643
|
};
|
|
642
|
-
if (typeof entry.signal !== 'undefined')
|
|
643
|
-
|
|
644
|
-
removeEntry(entry);
|
|
645
|
-
else
|
|
646
|
-
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
647
|
-
}
|
|
644
|
+
if (typeof entry.signal !== 'undefined')
|
|
645
|
+
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
648
646
|
return function unsubscribe() {
|
|
649
647
|
removeEntry(entry);
|
|
650
648
|
};
|
|
@@ -678,9 +676,9 @@ function getAppearanceFromEngine() {
|
|
|
678
676
|
return Appearances.Light;
|
|
679
677
|
}
|
|
680
678
|
function getAppearanceFromMediaQuery() {
|
|
681
|
-
if (
|
|
679
|
+
if (PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST.media === 'not all')
|
|
682
680
|
return Appearances.Unknown;
|
|
683
|
-
if (
|
|
681
|
+
if (PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST.matches)
|
|
684
682
|
return Appearances.Dark;
|
|
685
683
|
return Appearances.Light;
|
|
686
684
|
}
|
|
@@ -708,13 +706,13 @@ function stopPolling() {
|
|
|
708
706
|
}
|
|
709
707
|
function attachOnChange() {
|
|
710
708
|
appearanceRef = getAppearanceFromMediaQuery();
|
|
711
|
-
EventListener.add(
|
|
709
|
+
EventListener.add(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
712
710
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
713
711
|
startPolling();
|
|
714
712
|
}
|
|
715
713
|
function detachOnChange() {
|
|
716
714
|
appearanceRef = null;
|
|
717
|
-
EventListener.remove(
|
|
715
|
+
EventListener.remove(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
718
716
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
719
717
|
stopPolling();
|
|
720
718
|
}
|
|
@@ -728,4 +726,4 @@ function onMediaChange(event) {
|
|
|
728
726
|
onChangeSubscriptionManager.emit(appearanceRef = appearance);
|
|
729
727
|
}
|
|
730
728
|
|
|
731
|
-
export { Appearances, CONTEXT,
|
|
729
|
+
export { Appearances, CONTEXT, PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, SVG_PIXEL_DATA_URL, Appearance as default };
|
|
@@ -3,6 +3,6 @@ export declare enum Appearances {
|
|
|
3
3
|
Light = "light",
|
|
4
4
|
Dark = "dark"
|
|
5
5
|
}
|
|
6
|
-
export declare let
|
|
6
|
+
export declare let PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST: MediaQueryList;
|
|
7
7
|
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
8
8
|
export declare const SVG_PIXEL_DATA_URL: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Dimensions } from "../types";
|
|
2
1
|
export declare enum Orientation {
|
|
3
2
|
Portrait = "portrait",
|
|
4
3
|
Landscape = "landscape",
|
|
@@ -40,5 +39,5 @@ export declare const ENV_PRESETS: {
|
|
|
40
39
|
readonly left: "viewport-segment-left";
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
|
-
export declare
|
|
44
|
-
export declare let
|
|
42
|
+
export declare let ORIENTATION_MEDIA_QUERY_LIST: MediaQueryList;
|
|
43
|
+
export declare let DEVICE_POSTURE_MEDIA_QUERY_LIST: MediaQueryList;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import { DimensionInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
interface DOMRectReadOnly {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly top: number;
|
|
9
|
+
readonly right: number;
|
|
10
|
+
readonly bottom: number;
|
|
11
|
+
readonly left: number;
|
|
12
|
+
}
|
|
13
|
+
interface VisualViewport {
|
|
14
|
+
readonly segments?: DOMRectReadOnly[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
2
17
|
declare const Dimension: DimensionInstance;
|
|
3
18
|
export default Dimension;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { ENV_PRESETS, Orientation } from "../constants";
|
|
2
2
|
export type EnvironmentPresetKey = keyof typeof ENV_PRESETS;
|
|
3
|
-
export type
|
|
3
|
+
export type EnvironmentPresetAttribute<K extends EnvironmentPresetKey> = keyof typeof ENV_PRESETS[K];
|
|
4
4
|
export type EnvironmentPresetValues<K extends EnvironmentPresetKey> = {
|
|
5
|
-
[P in
|
|
5
|
+
[P in EnvironmentPresetAttribute<K>]: number;
|
|
6
6
|
};
|
|
7
|
-
export declare interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export declare interface Environment {
|
|
8
|
+
safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
|
|
9
|
+
safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
|
|
10
|
+
keyboardInset: EnvironmentObserver<'keyboard-inset'>;
|
|
11
|
+
titlebarArea: EnvironmentObserver<'titlebar-area'>;
|
|
12
|
+
viewportSegment: EnvironmentObserver<'viewport-segment'>;
|
|
13
|
+
}
|
|
14
|
+
export declare interface SegmentsObserver {
|
|
15
|
+
get value(): EnvironmentPresetValues<'viewport-segment'>[];
|
|
16
|
+
onChange(listener: (value: EnvironmentPresetValues<'viewport-segment'>[]) => void, options?: AddEventListenerOptions): () => void;
|
|
17
|
+
useCssVariable(prefix: string): () => void;
|
|
15
18
|
}
|
|
19
|
+
export declare type EnvironmentObserver<K extends EnvironmentPresetKey> = K extends 'viewport-segment' ? SegmentsObserver : {
|
|
20
|
+
get value(): EnvironmentPresetValues<K>;
|
|
21
|
+
onChange(listener: (value: EnvironmentPresetValues<K>) => void, options?: AddEventListenerOptions): () => void;
|
|
22
|
+
useCssVariable(prefix: string): () => void;
|
|
23
|
+
};
|
|
16
24
|
export declare interface Dimensions {
|
|
17
25
|
outerWidth: number;
|
|
18
26
|
outerHeight: number;
|
|
@@ -21,14 +29,12 @@ export declare interface Dimensions {
|
|
|
21
29
|
scale: number;
|
|
22
30
|
orientation: Orientation;
|
|
23
31
|
}
|
|
24
|
-
export declare interface
|
|
25
|
-
get value():
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
titlebarArea: EnvironmentPreset<'titlebar-area'>;
|
|
33
|
-
viewportSegment: EnvironmentPreset<'viewport-segment'>;
|
|
32
|
+
export declare interface DimensionInstance {
|
|
33
|
+
get value(): Dimensions;
|
|
34
|
+
environment: Environment;
|
|
35
|
+
onChange(listener: (dimension: Dimensions) => void, options?: AddEventListenerOptions): () => void;
|
|
36
|
+
Constants: {
|
|
37
|
+
Orientation: typeof Orientation;
|
|
38
|
+
};
|
|
39
|
+
Errors: {};
|
|
34
40
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvironmentObserver, EnvironmentPresetKey } from "../types";
|
|
2
2
|
declare global {
|
|
3
3
|
interface Navigator {
|
|
4
4
|
readonly virtualKeyboard?: VirtualKeyboard;
|
|
5
|
+
readonly devicePosture?: DevicePosture;
|
|
5
6
|
}
|
|
7
|
+
var viewport: BrowsingContextViewport | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface DevicePosture extends EventTarget {
|
|
10
|
+
readonly type: 'continuous' | 'folded';
|
|
11
|
+
onchange: ((this: DevicePosture, ev: Event) => any) | null;
|
|
6
12
|
}
|
|
7
|
-
type ChangeCallback<K extends EnvironmentPresetKey> = (values: EnvironmentPresetValues<K>) => void;
|
|
8
13
|
interface VirtualKeyboardEventMap {
|
|
9
14
|
geometrychange: Event;
|
|
10
15
|
}
|
|
@@ -16,9 +21,13 @@ interface VirtualKeyboard extends EventTarget {
|
|
|
16
21
|
addEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: AddEventListenerOptions): void;
|
|
17
22
|
removeEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
interface BrowsingContextViewportEventMap {
|
|
25
|
+
change: Event;
|
|
26
|
+
}
|
|
27
|
+
interface BrowsingContextViewport extends EventTarget {
|
|
28
|
+
readonly segments: ReadonlyArray<DOMRectReadOnly> | null;
|
|
29
|
+
addEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
30
|
+
removeEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
31
|
+
}
|
|
32
|
+
export default function createEnvObserver<K extends EnvironmentPresetKey>(preset: K): EnvironmentObserver<K>;
|
|
24
33
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EnvironmentObserver, EnvironmentPresetKey } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Navigator {
|
|
4
|
+
readonly virtualKeyboard?: VirtualKeyboard;
|
|
5
|
+
readonly devicePosture?: DevicePosture;
|
|
6
|
+
}
|
|
7
|
+
var viewport: BrowsingContextViewport | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface DevicePosture extends EventTarget {
|
|
10
|
+
readonly type: 'continuous' | 'folded';
|
|
11
|
+
onchange: ((this: DevicePosture, ev: Event) => any) | null;
|
|
12
|
+
}
|
|
13
|
+
interface VirtualKeyboardEventMap {
|
|
14
|
+
geometrychange: Event;
|
|
15
|
+
}
|
|
16
|
+
interface VirtualKeyboard extends EventTarget {
|
|
17
|
+
readonly boundingRect: DOMRect;
|
|
18
|
+
overlaysContent: boolean;
|
|
19
|
+
show(): void;
|
|
20
|
+
hide(): void;
|
|
21
|
+
addEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: AddEventListenerOptions): void;
|
|
22
|
+
removeEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
23
|
+
}
|
|
24
|
+
interface BrowsingContextViewportEventMap {
|
|
25
|
+
change: Event;
|
|
26
|
+
}
|
|
27
|
+
interface BrowsingContextViewport extends EventTarget {
|
|
28
|
+
readonly segments: ReadonlyArray<DOMRectReadOnly> | null;
|
|
29
|
+
addEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
30
|
+
removeEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
31
|
+
}
|
|
32
|
+
export default function createEnvironmentObserver<K extends EnvironmentPresetKey>(preset: K): EnvironmentObserver<K>;
|
|
33
|
+
export {};
|
|
@@ -34,7 +34,7 @@ export declare enum Browsers {
|
|
|
34
34
|
IE = "IE",
|
|
35
35
|
SamsungInternet = "SamsungInternet"
|
|
36
36
|
}
|
|
37
|
-
export declare
|
|
37
|
+
export declare let USER_AGENT: string;
|
|
38
38
|
export declare const HIGH_ENTROPY_BRAND_NAME_MAP: Record<string, string>;
|
|
39
39
|
export declare const RTL_LANGUAGES: string[];
|
|
40
40
|
export declare const OS_RESOLVER_MAP: [RegExp, OS, VersionResolver?][];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function insertionSort(arr: number[]): void;
|
|
@@ -3,6 +3,6 @@ export declare enum Appearances {
|
|
|
3
3
|
Light = "light",
|
|
4
4
|
Dark = "dark"
|
|
5
5
|
}
|
|
6
|
-
export declare let
|
|
6
|
+
export declare let PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST: MediaQueryList;
|
|
7
7
|
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
8
8
|
export declare const SVG_PIXEL_DATA_URL: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Dimensions } from "../types";
|
|
2
1
|
export declare enum Orientation {
|
|
3
2
|
Portrait = "portrait",
|
|
4
3
|
Landscape = "landscape",
|
|
@@ -40,5 +39,5 @@ export declare const ENV_PRESETS: {
|
|
|
40
39
|
readonly left: "viewport-segment-left";
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
|
-
export declare
|
|
44
|
-
export declare let
|
|
42
|
+
export declare let ORIENTATION_MEDIA_QUERY_LIST: MediaQueryList;
|
|
43
|
+
export declare let DEVICE_POSTURE_MEDIA_QUERY_LIST: MediaQueryList;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import { DimensionInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
interface DOMRectReadOnly {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly top: number;
|
|
9
|
+
readonly right: number;
|
|
10
|
+
readonly bottom: number;
|
|
11
|
+
readonly left: number;
|
|
12
|
+
}
|
|
13
|
+
interface VisualViewport {
|
|
14
|
+
readonly segments?: DOMRectReadOnly[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
2
17
|
declare const Dimension: DimensionInstance;
|
|
3
18
|
export default Dimension;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { ENV_PRESETS, Orientation } from "../constants";
|
|
2
2
|
export type EnvironmentPresetKey = keyof typeof ENV_PRESETS;
|
|
3
|
-
export type
|
|
3
|
+
export type EnvironmentPresetAttribute<K extends EnvironmentPresetKey> = keyof typeof ENV_PRESETS[K];
|
|
4
4
|
export type EnvironmentPresetValues<K extends EnvironmentPresetKey> = {
|
|
5
|
-
[P in
|
|
5
|
+
[P in EnvironmentPresetAttribute<K>]: number;
|
|
6
6
|
};
|
|
7
|
-
export declare interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export declare interface Environment {
|
|
8
|
+
safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
|
|
9
|
+
safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
|
|
10
|
+
keyboardInset: EnvironmentObserver<'keyboard-inset'>;
|
|
11
|
+
titlebarArea: EnvironmentObserver<'titlebar-area'>;
|
|
12
|
+
viewportSegment: EnvironmentObserver<'viewport-segment'>;
|
|
13
|
+
}
|
|
14
|
+
export declare interface SegmentsObserver {
|
|
15
|
+
get value(): EnvironmentPresetValues<'viewport-segment'>[];
|
|
16
|
+
onChange(listener: (value: EnvironmentPresetValues<'viewport-segment'>[]) => void, options?: AddEventListenerOptions): () => void;
|
|
17
|
+
useCssVariable(prefix: string): () => void;
|
|
15
18
|
}
|
|
19
|
+
export declare type EnvironmentObserver<K extends EnvironmentPresetKey> = K extends 'viewport-segment' ? SegmentsObserver : {
|
|
20
|
+
get value(): EnvironmentPresetValues<K>;
|
|
21
|
+
onChange(listener: (value: EnvironmentPresetValues<K>) => void, options?: AddEventListenerOptions): () => void;
|
|
22
|
+
useCssVariable(prefix: string): () => void;
|
|
23
|
+
};
|
|
16
24
|
export declare interface Dimensions {
|
|
17
25
|
outerWidth: number;
|
|
18
26
|
outerHeight: number;
|
|
@@ -21,14 +29,12 @@ export declare interface Dimensions {
|
|
|
21
29
|
scale: number;
|
|
22
30
|
orientation: Orientation;
|
|
23
31
|
}
|
|
24
|
-
export declare interface
|
|
25
|
-
get value():
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
titlebarArea: EnvironmentPreset<'titlebar-area'>;
|
|
33
|
-
viewportSegment: EnvironmentPreset<'viewport-segment'>;
|
|
32
|
+
export declare interface DimensionInstance {
|
|
33
|
+
get value(): Dimensions;
|
|
34
|
+
environment: Environment;
|
|
35
|
+
onChange(listener: (dimension: Dimensions) => void, options?: AddEventListenerOptions): () => void;
|
|
36
|
+
Constants: {
|
|
37
|
+
Orientation: typeof Orientation;
|
|
38
|
+
};
|
|
39
|
+
Errors: {};
|
|
34
40
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvironmentObserver, EnvironmentPresetKey } from "../types";
|
|
2
2
|
declare global {
|
|
3
3
|
interface Navigator {
|
|
4
4
|
readonly virtualKeyboard?: VirtualKeyboard;
|
|
5
|
+
readonly devicePosture?: DevicePosture;
|
|
5
6
|
}
|
|
7
|
+
var viewport: BrowsingContextViewport | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface DevicePosture extends EventTarget {
|
|
10
|
+
readonly type: 'continuous' | 'folded';
|
|
11
|
+
onchange: ((this: DevicePosture, ev: Event) => any) | null;
|
|
6
12
|
}
|
|
7
|
-
type ChangeCallback<K extends EnvironmentPresetKey> = (values: EnvironmentPresetValues<K>) => void;
|
|
8
13
|
interface VirtualKeyboardEventMap {
|
|
9
14
|
geometrychange: Event;
|
|
10
15
|
}
|
|
@@ -16,9 +21,13 @@ interface VirtualKeyboard extends EventTarget {
|
|
|
16
21
|
addEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: AddEventListenerOptions): void;
|
|
17
22
|
removeEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
interface BrowsingContextViewportEventMap {
|
|
25
|
+
change: Event;
|
|
26
|
+
}
|
|
27
|
+
interface BrowsingContextViewport extends EventTarget {
|
|
28
|
+
readonly segments: ReadonlyArray<DOMRectReadOnly> | null;
|
|
29
|
+
addEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
30
|
+
removeEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
31
|
+
}
|
|
32
|
+
export default function createEnvObserver<K extends EnvironmentPresetKey>(preset: K): EnvironmentObserver<K>;
|
|
24
33
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EnvironmentObserver, EnvironmentPresetKey } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Navigator {
|
|
4
|
+
readonly virtualKeyboard?: VirtualKeyboard;
|
|
5
|
+
readonly devicePosture?: DevicePosture;
|
|
6
|
+
}
|
|
7
|
+
var viewport: BrowsingContextViewport | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface DevicePosture extends EventTarget {
|
|
10
|
+
readonly type: 'continuous' | 'folded';
|
|
11
|
+
onchange: ((this: DevicePosture, ev: Event) => any) | null;
|
|
12
|
+
}
|
|
13
|
+
interface VirtualKeyboardEventMap {
|
|
14
|
+
geometrychange: Event;
|
|
15
|
+
}
|
|
16
|
+
interface VirtualKeyboard extends EventTarget {
|
|
17
|
+
readonly boundingRect: DOMRect;
|
|
18
|
+
overlaysContent: boolean;
|
|
19
|
+
show(): void;
|
|
20
|
+
hide(): void;
|
|
21
|
+
addEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: AddEventListenerOptions): void;
|
|
22
|
+
removeEventListener<K extends keyof VirtualKeyboardEventMap>(type: K, listener: (this: VirtualKeyboard, ev: VirtualKeyboardEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
23
|
+
}
|
|
24
|
+
interface BrowsingContextViewportEventMap {
|
|
25
|
+
change: Event;
|
|
26
|
+
}
|
|
27
|
+
interface BrowsingContextViewport extends EventTarget {
|
|
28
|
+
readonly segments: ReadonlyArray<DOMRectReadOnly> | null;
|
|
29
|
+
addEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
30
|
+
removeEventListener<K extends keyof BrowsingContextViewportEventMap>(type: K, listener: (this: BrowsingContextViewport, ev: BrowsingContextViewportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
31
|
+
}
|
|
32
|
+
export default function createEnvironmentObserver<K extends EnvironmentPresetKey>(preset: K): EnvironmentObserver<K>;
|
|
33
|
+
export {};
|
|
@@ -34,7 +34,7 @@ export declare enum Browsers {
|
|
|
34
34
|
IE = "IE",
|
|
35
35
|
SamsungInternet = "SamsungInternet"
|
|
36
36
|
}
|
|
37
|
-
export declare
|
|
37
|
+
export declare let USER_AGENT: string;
|
|
38
38
|
export declare const HIGH_ENTROPY_BRAND_NAME_MAP: Record<string, string>;
|
|
39
39
|
export declare const RTL_LANGUAGES: string[];
|
|
40
40
|
export declare const OS_RESOLVER_MAP: [RegExp, OS, VersionResolver?][];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function insertionSort(arr: number[]): void;
|
|
@@ -317,6 +317,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
317
317
|
},
|
|
318
318
|
subscribe: function (listener, options) {
|
|
319
319
|
if (options === void 0) { options = {}; }
|
|
320
|
+
if (typeof options.signal !== 'undefined' && options.signal.aborted)
|
|
321
|
+
return function () { };
|
|
320
322
|
var entry = { fn: listener, once: false };
|
|
321
323
|
if (typeof options.once !== 'undefined')
|
|
322
324
|
entry.once = options.once;
|
|
@@ -335,12 +337,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
335
337
|
EventListener.remove(entry.signal, { type: 'abort', callback: cleanup });
|
|
336
338
|
removeEntry(entry);
|
|
337
339
|
};
|
|
338
|
-
if (typeof entry.signal !== 'undefined')
|
|
339
|
-
|
|
340
|
-
removeEntry(entry);
|
|
341
|
-
else
|
|
342
|
-
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
343
|
-
}
|
|
340
|
+
if (typeof entry.signal !== 'undefined')
|
|
341
|
+
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
344
342
|
return function unsubscribe() {
|
|
345
343
|
removeEntry(entry);
|
|
346
344
|
};
|
|
@@ -315,6 +315,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
315
315
|
},
|
|
316
316
|
subscribe: function (listener, options) {
|
|
317
317
|
if (options === void 0) { options = {}; }
|
|
318
|
+
if (typeof options.signal !== 'undefined' && options.signal.aborted)
|
|
319
|
+
return function () { };
|
|
318
320
|
var entry = { fn: listener, once: false };
|
|
319
321
|
if (typeof options.once !== 'undefined')
|
|
320
322
|
entry.once = options.once;
|
|
@@ -333,12 +335,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
333
335
|
EventListener.remove(entry.signal, { type: 'abort', callback: cleanup });
|
|
334
336
|
removeEntry(entry);
|
|
335
337
|
};
|
|
336
|
-
if (typeof entry.signal !== 'undefined')
|
|
337
|
-
|
|
338
|
-
removeEntry(entry);
|
|
339
|
-
else
|
|
340
|
-
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
341
|
-
}
|
|
338
|
+
if (typeof entry.signal !== 'undefined')
|
|
339
|
+
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
342
340
|
return function unsubscribe() {
|
|
343
341
|
removeEntry(entry);
|
|
344
342
|
};
|
|
@@ -3,6 +3,6 @@ export declare enum Appearances {
|
|
|
3
3
|
Light = "light",
|
|
4
4
|
Dark = "dark"
|
|
5
5
|
}
|
|
6
|
-
export declare let
|
|
6
|
+
export declare let PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST: MediaQueryList;
|
|
7
7
|
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
8
8
|
export declare const SVG_PIXEL_DATA_URL: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Dimensions } from "../types";
|
|
2
1
|
export declare enum Orientation {
|
|
3
2
|
Portrait = "portrait",
|
|
4
3
|
Landscape = "landscape",
|
|
@@ -40,5 +39,5 @@ export declare const ENV_PRESETS: {
|
|
|
40
39
|
readonly left: "viewport-segment-left";
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
|
-
export declare
|
|
44
|
-
export declare let
|
|
42
|
+
export declare let ORIENTATION_MEDIA_QUERY_LIST: MediaQueryList;
|
|
43
|
+
export declare let DEVICE_POSTURE_MEDIA_QUERY_LIST: MediaQueryList;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import { DimensionInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
interface DOMRectReadOnly {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly top: number;
|
|
9
|
+
readonly right: number;
|
|
10
|
+
readonly bottom: number;
|
|
11
|
+
readonly left: number;
|
|
12
|
+
}
|
|
13
|
+
interface VisualViewport {
|
|
14
|
+
readonly segments?: DOMRectReadOnly[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
2
17
|
declare const Dimension: DimensionInstance;
|
|
3
18
|
export default Dimension;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { ENV_PRESETS, Orientation } from "../constants";
|
|
2
2
|
export type EnvironmentPresetKey = keyof typeof ENV_PRESETS;
|
|
3
|
-
export type
|
|
3
|
+
export type EnvironmentPresetAttribute<K extends EnvironmentPresetKey> = keyof typeof ENV_PRESETS[K];
|
|
4
4
|
export type EnvironmentPresetValues<K extends EnvironmentPresetKey> = {
|
|
5
|
-
[P in
|
|
5
|
+
[P in EnvironmentPresetAttribute<K>]: number;
|
|
6
6
|
};
|
|
7
|
-
export declare interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export declare interface Environment {
|
|
8
|
+
safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
|
|
9
|
+
safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
|
|
10
|
+
keyboardInset: EnvironmentObserver<'keyboard-inset'>;
|
|
11
|
+
titlebarArea: EnvironmentObserver<'titlebar-area'>;
|
|
12
|
+
viewportSegment: EnvironmentObserver<'viewport-segment'>;
|
|
13
|
+
}
|
|
14
|
+
export declare interface SegmentsObserver {
|
|
15
|
+
get value(): EnvironmentPresetValues<'viewport-segment'>[];
|
|
16
|
+
onChange(listener: (value: EnvironmentPresetValues<'viewport-segment'>[]) => void, options?: AddEventListenerOptions): () => void;
|
|
17
|
+
useCssVariable(prefix: string): () => void;
|
|
15
18
|
}
|
|
19
|
+
export declare type EnvironmentObserver<K extends EnvironmentPresetKey> = K extends 'viewport-segment' ? SegmentsObserver : {
|
|
20
|
+
get value(): EnvironmentPresetValues<K>;
|
|
21
|
+
onChange(listener: (value: EnvironmentPresetValues<K>) => void, options?: AddEventListenerOptions): () => void;
|
|
22
|
+
useCssVariable(prefix: string): () => void;
|
|
23
|
+
};
|
|
16
24
|
export declare interface Dimensions {
|
|
17
25
|
outerWidth: number;
|
|
18
26
|
outerHeight: number;
|
|
@@ -21,14 +29,12 @@ export declare interface Dimensions {
|
|
|
21
29
|
scale: number;
|
|
22
30
|
orientation: Orientation;
|
|
23
31
|
}
|
|
24
|
-
export declare interface
|
|
25
|
-
get value():
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
titlebarArea: EnvironmentPreset<'titlebar-area'>;
|
|
33
|
-
viewportSegment: EnvironmentPreset<'viewport-segment'>;
|
|
32
|
+
export declare interface DimensionInstance {
|
|
33
|
+
get value(): Dimensions;
|
|
34
|
+
environment: Environment;
|
|
35
|
+
onChange(listener: (dimension: Dimensions) => void, options?: AddEventListenerOptions): () => void;
|
|
36
|
+
Constants: {
|
|
37
|
+
Orientation: typeof Orientation;
|
|
38
|
+
};
|
|
39
|
+
Errors: {};
|
|
34
40
|
}
|