@contentful/app-sdk 4.16.0 → 4.17.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.
@@ -1,63 +1,63 @@
1
- import { Asset, Entry, KeyValueMap } from './entities';
2
- export interface NavigatorAPIOptions {
3
- /** use `waitForClose` if you want promise to be resolved only after slide in editor is closed */
4
- slideIn?: boolean | {
5
- waitForClose: boolean;
6
- };
7
- }
8
- export interface PageExtensionOptions {
9
- /** If included, you can navigate to a different page extension. If omitted, you will navigate within the current extension. */
10
- id?: string;
11
- /** Navigate to a path within your page extension. */
12
- path?: string;
13
- }
14
- export interface AppPageLocationOptions {
15
- /** A path to navigate to within your app's page location. */
16
- path?: string;
17
- }
18
- /** Information about current value of the navigation status. */
19
- export interface NavigatorPageResponse {
20
- /** Will be true if navigation was successfully executed by the web app. */
21
- navigated: boolean;
22
- /** The path that was navigated to by the web app. */
23
- path: string;
24
- }
25
- export interface NavigatorSlideInfo {
26
- newSlideLevel: number;
27
- oldSlideLevel: number;
28
- }
29
- export interface NavigatorOpenResponse<T> {
30
- navigated: boolean;
31
- entity?: T;
32
- slide?: NavigatorSlideInfo;
33
- }
34
- export interface NavigatorAPI {
35
- /** Opens an existing entry in the current Web App session. */
36
- openEntry: <Fields extends KeyValueMap = KeyValueMap>(entryId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Entry<Fields>>>;
37
- /** Opens an existing asset in the current Web App session. */
38
- openAsset: (assetId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Asset>>;
39
- /** Opens a new entry in the current Web App session. */
40
- openNewEntry: <Fields extends KeyValueMap = KeyValueMap>(contentTypeId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Entry<Fields>>>;
41
- /** Opens a new asset in the current Web App session. */
42
- openNewAsset: (options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Asset>>;
43
- /** Navigates to a page extension in the current Web App session. Calling without `options` will navigate to the home route of your page extension. */
44
- openPageExtension: (options?: PageExtensionOptions) => Promise<NavigatorPageResponse>;
45
- /** Navigates to the app's page location. */
46
- openCurrentAppPage: (options?: AppPageLocationOptions) => Promise<NavigatorPageResponse>;
47
- /** Navigates to a bulk entry editor */
48
- openBulkEditor: (entryId: string, options: {
49
- /** ID of the reference field */
50
- fieldId: string;
51
- /** Editable locale */
52
- locale: string;
53
- /** Focused index */
54
- index: number;
55
- }) => Promise<{
56
- navigated: boolean;
57
- slide?: NavigatorSlideInfo;
58
- }>;
59
- openAppConfig: () => Promise<void>;
60
- openEntriesList: () => Promise<void>;
61
- openAssetsList: () => Promise<void>;
62
- onSlideInNavigation: (fn: (slide: NavigatorSlideInfo) => void) => () => void;
63
- }
1
+ import { Asset, Entry, KeyValueMap } from './entities';
2
+ export interface NavigatorAPIOptions {
3
+ /** use `waitForClose` if you want promise to be resolved only after slide in editor is closed */
4
+ slideIn?: boolean | {
5
+ waitForClose: boolean;
6
+ };
7
+ }
8
+ export interface PageExtensionOptions {
9
+ /** If included, you can navigate to a different page extension. If omitted, you will navigate within the current extension. */
10
+ id?: string;
11
+ /** Navigate to a path within your page extension. */
12
+ path?: string;
13
+ }
14
+ export interface AppPageLocationOptions {
15
+ /** A path to navigate to within your app's page location. */
16
+ path?: string;
17
+ }
18
+ /** Information about current value of the navigation status. */
19
+ export interface NavigatorPageResponse {
20
+ /** Will be true if navigation was successfully executed by the web app. */
21
+ navigated: boolean;
22
+ /** The path that was navigated to by the web app. */
23
+ path: string;
24
+ }
25
+ export interface NavigatorSlideInfo {
26
+ newSlideLevel: number;
27
+ oldSlideLevel: number;
28
+ }
29
+ export interface NavigatorOpenResponse<T> {
30
+ navigated: boolean;
31
+ entity?: T;
32
+ slide?: NavigatorSlideInfo;
33
+ }
34
+ export interface NavigatorAPI {
35
+ /** Opens an existing entry in the current Web App session. */
36
+ openEntry: <Fields extends KeyValueMap = KeyValueMap>(entryId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Entry<Fields>>>;
37
+ /** Opens an existing asset in the current Web App session. */
38
+ openAsset: (assetId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Asset>>;
39
+ /** Opens a new entry in the current Web App session. */
40
+ openNewEntry: <Fields extends KeyValueMap = KeyValueMap>(contentTypeId: string, options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Entry<Fields>>>;
41
+ /** Opens a new asset in the current Web App session. */
42
+ openNewAsset: (options?: NavigatorAPIOptions) => Promise<NavigatorOpenResponse<Asset>>;
43
+ /** Navigates to a page extension in the current Web App session. Calling without `options` will navigate to the home route of your page extension. */
44
+ openPageExtension: (options?: PageExtensionOptions) => Promise<NavigatorPageResponse>;
45
+ /** Navigates to the app's page location. */
46
+ openCurrentAppPage: (options?: AppPageLocationOptions) => Promise<NavigatorPageResponse>;
47
+ /** Navigates to a bulk entry editor */
48
+ openBulkEditor: (entryId: string, options: {
49
+ /** ID of the reference field */
50
+ fieldId: string;
51
+ /** Editable locale */
52
+ locale: string;
53
+ /** Focused index */
54
+ index: number;
55
+ }) => Promise<{
56
+ navigated: boolean;
57
+ slide?: NavigatorSlideInfo;
58
+ }>;
59
+ openAppConfig: () => Promise<void>;
60
+ openEntriesList: () => Promise<void>;
61
+ openAssetsList: () => Promise<void>;
62
+ onSlideInNavigation: (fn: (slide: NavigatorSlideInfo) => void) => () => void;
63
+ }