-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
types.ts
50 lines (43 loc) · 1.34 KB
/
types.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
import * as PropTypes from 'prop-types';
import {ValidationMap} from 'react';
import {ClientApplication} from '@shopify/app-bridge';
import {
THEME_CONTEXT_TYPES as polarisTheme,
ThemeContext,
} from '../ThemeProvider';
import Intl from './Intl';
import Link from './Link';
import StickyManager from './StickyManager';
import ScrollLockManager from './ScrollLockManager';
import {Props as AppProviderProps} from '.';
export const polarisAppProviderContextTypes: ValidationMap<any> = {
polaris: PropTypes.any,
...polarisTheme,
};
export interface WithAppProviderProps {
polaris: {
intl: Intl;
link: Link;
stickyManager: StickyManager;
scrollLockManager: ScrollLockManager;
theme: ThemeContext;
appBridge: ClientApplication<{}>;
subscribe(callback: () => void): void;
unsubscribe(callback: () => void): void;
};
}
export interface TranslationDictionary {
[key: string]: string | TranslationDictionary;
}
export interface PrimitiveReplacementDictionary {
[key: string]: string | number;
}
export interface ComplexReplacementDictionary {
[key: string]: string | number | React.ReactNode;
}
export interface CreateAppProviderContext extends AppProviderProps {
stickyManager?: StickyManager;
scrollLockManager?: ScrollLockManager;
subscribe?(callback: () => void): void;
unsubscribe?(callback: () => void): void;
}