@frontify/app-bridge-theme
Advanced tools
Comparing version 0.0.0-alpha.5 to 0.0.0-alpha.6
@@ -47,2 +47,8 @@ import { Simplify } from 'type-fest'; | ||
export declare interface BrandPortalLink { | ||
isEnabled(): boolean; | ||
title(language?: string): string; | ||
url(language?: string): string; | ||
} | ||
declare type CloseSearchDialog = void; | ||
@@ -112,2 +118,17 @@ | ||
export declare interface CoverPage extends CoverPageBase { | ||
} | ||
declare interface CoverPageBase { | ||
id(): number; | ||
title(language?: string): string; | ||
isPublished(): boolean; | ||
isHiddenInNavigation(): boolean; | ||
url(language?: string): string; | ||
type: 'cover-page'; | ||
} | ||
export declare interface CoverPageNavigationItem extends CoverPageBase { | ||
} | ||
declare type DispatchHandler<CommandName extends keyof CommandNamePattern, Command extends CommandNamePattern> = Command[CommandName] extends void ? { | ||
@@ -122,56 +143,29 @@ name: CommandName; | ||
export declare type DocumentNavigationItem = GuidelinePageCategory | GuidelineDocumentPage | GuidelineDocumentPageLink | GuidelineDocumentPageHeading; | ||
export declare type EventCallbackParameter<EventName, AppBridgeThemeEvent> = EventName extends keyof AppBridgeThemeEvent ? AppBridgeThemeEvent[EventName] extends any[] ? (...eventReturn: AppBridgeThemeEvent[EventName]) => void : (eventReturn: AppBridgeThemeEvent[EventName]) => void : () => void; | ||
export declare type EventNameParameter<EventName, EventNameParameter extends EventNamePattern> = EventName extends keyof EventNameParameter ? EventName : WrongNamePattern<EventName, 'Event'>; | ||
export declare type EventNamePattern = { | ||
[eventName: `Context.${string}` | `${string}${Capitalize<EventVerb>}`]: unknown; | ||
}; | ||
export declare type EventNameValidator<EventNameObject> = Simplify<ObjectNameValidator<EventNameObject, EventNamePattern, 'Event'>>; | ||
export declare type EventRegistry = EventNameValidator<{ | ||
assetsChosen: { | ||
assets: Asset[]; | ||
}; | ||
}>; | ||
export declare type EventUnsubscribeFunction = () => void; | ||
declare type EventVerb = 'chosen'; | ||
export declare interface GuidelineBrandPortalLink { | ||
isEnabled(): boolean; | ||
title(language?: string): string; | ||
url(language?: string): string; | ||
declare interface Document_2 extends DocumentBase { | ||
documentGroupId(): Nullable<number>; | ||
} | ||
export { Document_2 as Document } | ||
export declare interface GuidelineCoverPage { | ||
declare interface DocumentBase { | ||
id(): number; | ||
title(language?: string): string; | ||
isPublished(): boolean; | ||
isHiddenInNavigation(): boolean; | ||
url(language?: string): string; | ||
type: 'cover-page'; | ||
} | ||
export declare interface GuidelineDocument { | ||
id(): number; | ||
title(language?: string): string; | ||
slug(language?: string): string; | ||
url(language?: string): string; | ||
parentId(): Nullable<number>; | ||
type: 'document'; | ||
} | ||
export declare interface GuidelineDocumentGroup { | ||
export declare type DocumentChildNavigationItem = PageCategoryNavigationItem | DocumentPageNavigationItem | DocumentPageLinkNavigationItem; | ||
export declare interface DocumentGroupNavigationItem { | ||
id(): number; | ||
title(language?: string): string; | ||
children(): (GuidelineDocument | GuidelineDocumentLibrary | GuidelineDocumentLink)[]; | ||
children(): (DocumentNavigationItem | DocumentLibraryNavigationItem | DocumentLinkNavigationItem)[]; | ||
type: 'document-group'; | ||
} | ||
export declare interface GuidelineDocumentLibrary { | ||
export declare interface DocumentLibrary extends DocumentLibraryBase { | ||
documentGroupId(): Nullable<number>; | ||
} | ||
declare interface DocumentLibraryBase { | ||
id(): number; | ||
@@ -181,7 +175,10 @@ title(language?: string): string; | ||
url(language?: string): string; | ||
parentId(): Nullable<number>; | ||
type: 'document-library'; | ||
} | ||
export declare interface GuidelineDocumentLink { | ||
export declare interface DocumentLibraryNavigationItem extends DocumentLibraryBase { | ||
parentId(): Nullable<number>; | ||
} | ||
export declare interface DocumentLinkNavigationItem { | ||
id(): number; | ||
@@ -198,3 +195,12 @@ title(language?: string): string; | ||
export declare interface GuidelineDocumentPage { | ||
export declare interface DocumentNavigationItem extends DocumentBase { | ||
parentId(): Nullable<number>; | ||
} | ||
export declare interface DocumentPage extends DocumentPageBase { | ||
categoryId(): Nullable<number>; | ||
documentId(): number; | ||
} | ||
declare interface DocumentPageBase { | ||
id(): number; | ||
@@ -204,7 +210,6 @@ title(language?: string): string; | ||
url(language?: string): string; | ||
headings(): GuidelineDocumentPageHeading[]; | ||
type: 'document-page'; | ||
} | ||
export declare interface GuidelineDocumentPageHeading { | ||
export declare interface DocumentPageHeadingNavigationItem { | ||
id(): number; | ||
@@ -216,3 +221,3 @@ title(language?: string): string; | ||
export declare interface GuidelineDocumentPageLink { | ||
export declare interface DocumentPageLinkNavigationItem { | ||
id(): number; | ||
@@ -224,10 +229,26 @@ title(language?: string): string; | ||
export declare interface GuidelinePageCategory { | ||
id(): number; | ||
title(language?: string): string; | ||
slug(language?: string): string; | ||
children(): (GuidelineDocumentPage | GuidelineDocumentPageLink)[]; | ||
type: 'page-category'; | ||
export declare interface DocumentPageNavigationItem extends DocumentPageBase { | ||
headings(): DocumentPageHeadingNavigationItem[]; | ||
} | ||
export declare type EventCallbackParameter<EventName, AppBridgeThemeEvent> = EventName extends keyof AppBridgeThemeEvent ? AppBridgeThemeEvent[EventName] extends any[] ? (...eventReturn: AppBridgeThemeEvent[EventName]) => void : (eventReturn: AppBridgeThemeEvent[EventName]) => void : () => void; | ||
export declare type EventNameParameter<EventName, EventNameParameter extends EventNamePattern> = EventName extends keyof EventNameParameter ? EventName : WrongNamePattern<EventName, 'Event'>; | ||
export declare type EventNamePattern = { | ||
[eventName: `Context.${string}` | `${string}${Capitalize<EventVerb>}`]: unknown; | ||
}; | ||
export declare type EventNameValidator<EventNameObject> = Simplify<ObjectNameValidator<EventNameObject, EventNamePattern, 'Event'>>; | ||
export declare type EventRegistry = EventNameValidator<{ | ||
assetsChosen: { | ||
assets: Asset[]; | ||
}; | ||
}>; | ||
export declare type EventUnsubscribeFunction = () => void; | ||
declare type EventVerb = 'chosen'; | ||
export declare type GuidelineSearchResult = { | ||
@@ -301,4 +322,12 @@ highlights: string[]; | ||
export declare type PortalNavigationItem = GuidelineCoverPage | GuidelineDocumentGroup | GuidelineDocument | GuidelineDocumentLibrary | GuidelineDocumentLink; | ||
export declare interface PageCategoryNavigationItem { | ||
id(): number; | ||
title(language?: string): string; | ||
slug(language?: string): string; | ||
children(): (DocumentPageNavigationItem | DocumentPageLinkNavigationItem)[]; | ||
type: 'page-category'; | ||
} | ||
export declare type PortalNavigationItem = CoverPageNavigationItem | DocumentGroupNavigationItem | DocumentNavigationItem | DocumentLibraryNavigationItem | DocumentLinkNavigationItem; | ||
export declare type SubscribeMap<Event> = { | ||
@@ -313,10 +342,10 @@ [EventName in keyof Event as EventName]: Map<EventCallbackParameter<keyof Event, Event>, boolean>; | ||
type: 'documentPage'; | ||
document: GuidelineDocument; | ||
documentPage: GuidelineDocumentPage; | ||
document: Document_2; | ||
documentPage: DocumentPage; | ||
} | { | ||
type: 'library'; | ||
document: GuidelineDocumentLibrary; | ||
document: DocumentLibrary; | ||
} | { | ||
type: 'cover'; | ||
coverPage: GuidelineCoverPage; | ||
coverPage: CoverPage; | ||
}); | ||
@@ -323,0 +352,0 @@ |
{ | ||
"name": "@frontify/app-bridge-theme", | ||
"type": "module", | ||
"version": "0.0.0-alpha.5", | ||
"version": "0.0.0-alpha.6", | ||
"description": "Package to establish communication between Frontify and themes", | ||
@@ -6,0 +6,0 @@ "author": "Frontify Developers <developers@frontify.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23979
310