@contentful/app-sdk 5.0.0-alpha.2 → 5.0.0-alpha.3
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/dist/app.d.ts +2 -1
- package/dist/types/api.types.d.ts +1 -1
- package/dist/types/app.types.d.ts +6 -6
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Channel } from './channel';
|
|
2
2
|
import { AppConfigAPI } from './types';
|
|
3
|
-
|
|
3
|
+
import { KeyValueMap } from './types/entities';
|
|
4
|
+
export default function createApp(channel: Channel): AppConfigAPI<KeyValueMap>;
|
|
@@ -228,7 +228,7 @@ export type ConfigAppSDK<InstallationParameters extends KeyValueMap = KeyValueMa
|
|
|
228
228
|
ids: Omit<IdsAPI, EntryScopedIds | 'app'> & {
|
|
229
229
|
app: string;
|
|
230
230
|
};
|
|
231
|
-
app: AppConfigAPI
|
|
231
|
+
app: AppConfigAPI<InstallationParameters>;
|
|
232
232
|
};
|
|
233
233
|
export type KnownAppSDK<InstallationParameters extends KeyValueMap = KeyValueMap, InstanceParameters extends KeyValueMap = KeyValueMap, InvocationParameters extends SerializedJSONValue = SerializedJSONValue> = FieldAppSDK<InstallationParameters, InstanceParameters> | SidebarAppSDK<InstallationParameters, InstanceParameters> | DialogAppSDK<InstallationParameters, InvocationParameters> | EditorAppSDK<InstallationParameters, InstanceParameters> | PageAppSDK<InstallationParameters> | ConfigAppSDK<InstallationParameters> | HomeAppSDK<InstallationParameters>;
|
|
234
234
|
export interface ConnectMessage {
|
|
@@ -16,12 +16,12 @@ interface AppStateEditorInterfaceItem {
|
|
|
16
16
|
export interface AppState {
|
|
17
17
|
EditorInterface: Record<ContentType['sys']['id'], AppStateEditorInterfaceItem>;
|
|
18
18
|
}
|
|
19
|
-
export type OnConfigureHandlerReturn = {
|
|
20
|
-
parameters?:
|
|
19
|
+
export type OnConfigureHandlerReturn<InstallationParameters extends KeyValueMap> = {
|
|
20
|
+
parameters?: InstallationParameters | null;
|
|
21
21
|
targetState?: AppState | null;
|
|
22
22
|
} | false;
|
|
23
|
-
export type OnConfigureHandler = () => OnConfigureHandlerReturn | Promise<OnConfigureHandlerReturn
|
|
24
|
-
export interface AppConfigAPI {
|
|
23
|
+
export type OnConfigureHandler<InstallationParameters extends KeyValueMap> = () => OnConfigureHandlerReturn<InstallationParameters> | Promise<OnConfigureHandlerReturn<InstallationParameters>>;
|
|
24
|
+
export interface AppConfigAPI<InstallationParameters extends KeyValueMap> {
|
|
25
25
|
/** Tells the web app that the app is loaded */
|
|
26
26
|
setReady: () => Promise<void>;
|
|
27
27
|
/** Returns true if an App is installed */
|
|
@@ -29,9 +29,9 @@ export interface AppConfigAPI {
|
|
|
29
29
|
/** Returns current state of an App */
|
|
30
30
|
getCurrentState: () => Promise<AppState | null>;
|
|
31
31
|
/** Returns parameters of an App, null otherwise */
|
|
32
|
-
getParameters:
|
|
32
|
+
getParameters: () => Promise<null | InstallationParameters>;
|
|
33
33
|
/** Registers a handler to be called to produce parameters for an App */
|
|
34
|
-
onConfigure: (handler: OnConfigureHandler) => void;
|
|
34
|
+
onConfigure: (handler: OnConfigureHandler<InstallationParameters>) => void;
|
|
35
35
|
/** Registers a handler to be called once configuration was finished */
|
|
36
36
|
onConfigurationCompleted: (handler: (err: null | {
|
|
37
37
|
message: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { Asset, CanonicalRequest, ContentType, ContentTypeField, EditorInte
|
|
|
5
5
|
export type { EntryAPI, TaskAPI, TaskInputData } from './entry.types';
|
|
6
6
|
export type { FieldInfo, EntryFieldInfo, EntryFieldAPI } from './field.types';
|
|
7
7
|
export type { FieldAPI } from './field-locale.types';
|
|
8
|
-
export type { NavigatorAPI, AppPageLocationOptions, NavigatorAPIOptions, NavigatorOpenResponse, NavigatorPageResponse, NavigatorSlideInfo, } from './navigator.types';
|
|
8
|
+
export type { NavigatorAPI, AppPageLocationOptions, NavigatorAPIOptions, NavigatorOpenResponse, NavigatorPageResponse, NavigatorSlideInfo, OpenEntriesListOptions, OpenAssetsListOptions, } from './navigator.types';
|
|
9
9
|
export type { SearchQuery, CollectionResponse, EntrySys, ContentEntitySys, ContentEntityType, FieldType, FieldLinkType, Items, Link, WithOptionalId, WithId, SerializedJSONValue, } from './utils';
|
|
10
10
|
export type { DateRangeValidationError, InValidationError, LinkContentTypeValidationError, LinkMimetypeGroupValidationError, NotResolvableValidationError, ProhibitRegexpValidationError, RangeValidationError, RegexpValidationError, RequiredValidationError, SizeValidationError, TypeValidationError, UniqueValidationError, UnknownValidationError, ValidationError, } from './validation-error';
|
|
11
11
|
export type { WindowAPI } from './window.types';
|
package/package.json
CHANGED