weboffice-js-sdk 2.0.4 → 2.0.5-beta.1
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.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const BRANDING_METHOD: {
|
|
2
|
+
readonly getEditorFooterLogo: "branding.getEditorFooterLogo";
|
|
3
|
+
readonly setEditorFooterLogoSrc: "branding.setEditorFooterLogoSrc";
|
|
4
|
+
};
|
|
5
|
+
export declare const BRANDING_CHANGED_EVENT = "branding:changed";
|
|
6
|
+
export type SDKBrandMode = '0' | '1' | '2';
|
|
7
|
+
export type SDKBrandSource = 0 | 1 | 2 | 3;
|
|
8
|
+
export interface SDKBrandConfig {
|
|
9
|
+
mode: SDKBrandMode;
|
|
10
|
+
customAddress?: string;
|
|
11
|
+
source: SDKBrandSource;
|
|
12
|
+
}
|
|
13
|
+
export interface BrandingChangedPayload {
|
|
14
|
+
editorFooterLogo?: SDKBrandConfig;
|
|
15
|
+
}
|
|
16
|
+
export interface BrandingFacade {
|
|
17
|
+
getEditorFooterLogo: () => Promise<SDKBrandConfig | undefined>;
|
|
18
|
+
setEditorFooterLogoSrc: (src: string) => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
interface BrandingHost {
|
|
21
|
+
getEditorFooterLogoState(): SDKBrandConfig | undefined;
|
|
22
|
+
setEditorFooterLogoState(config: SDKBrandConfig | undefined): void;
|
|
23
|
+
invokeBranding<T>(method: string, payload?: Record<string, unknown>): Promise<T>;
|
|
24
|
+
emitBrandingError(message: string, err: unknown): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function initBrandingFacade(host: BrandingHost): BrandingFacade;
|
|
27
|
+
export declare function applyBrandingChanged(host: BrandingHost, payload?: BrandingChangedPayload): void;
|
|
28
|
+
export {};
|
package/dist/OfficeSDK.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ import { BaseEditor } from './types/BaseEditor';
|
|
|
11
11
|
import { SlashMenuOptions } from './types/SlashMenu';
|
|
12
12
|
import type { CollaboratorFacade, CommentsFacade, ContentFacade, DiscussionFacade, DocsOutlineFacade, DocsSearchFacade, DocsSelectionFacade, DocsSettingsFacade, DocsSidebarFacade, DocsTablesFacade, ExternalAppFacade, HistoryFacade, LocksFacade, MentionFacade, PresentationEventSubscriptionFacade, PresentationFacade, PresentationSelectionFacade, PresentationSlidesFacade, PresentationTextFacade, PresentationZoomFacade, SheetChartsFacade, SheetSelectionsFacade, SheetWorkbookFacade, SheetWorksheetFacade, TitleFacade, VersionFacade } from './OfficeSDK.facade.types';
|
|
13
13
|
import type { HeaderBarsFacade } from './OfficeSDK.headerBars';
|
|
14
|
+
import type { BrandingFacade } from './OfficeSDK.branding';
|
|
14
15
|
export * from './OfficeSDK.facade.types';
|
|
15
16
|
export * from './OfficeSDK.headerBars';
|
|
17
|
+
export * from './OfficeSDK.branding';
|
|
16
18
|
export declare const MessageEvent: typeof InvokeMethod;
|
|
17
19
|
export declare class OfficeSDK extends TinyEmitter {
|
|
18
20
|
/**
|
|
@@ -168,6 +170,7 @@ export declare class OfficeSDK extends TinyEmitter {
|
|
|
168
170
|
*/
|
|
169
171
|
flowchart?: Flowchart.Editor;
|
|
170
172
|
readonly headerBars: HeaderBarsFacade;
|
|
173
|
+
readonly branding: BrandingFacade;
|
|
171
174
|
private _fileType;
|
|
172
175
|
private readonly messageHandler;
|
|
173
176
|
/**
|
|
@@ -200,6 +203,7 @@ export declare class OfficeSDK extends TinyEmitter {
|
|
|
200
203
|
private readonly headerBarsCommandRefs;
|
|
201
204
|
private headerBarsTitleChangeHandler?;
|
|
202
205
|
private headerBarsTitleChangeSubscribed;
|
|
206
|
+
private editorFooterLogo?;
|
|
203
207
|
private readonly onViewportResize;
|
|
204
208
|
/**
|
|
205
209
|
* 归一化后的缺省页配置,构造时一次算完,后续仅读取。
|
|
@@ -284,6 +288,7 @@ export declare class OfficeSDK extends TinyEmitter {
|
|
|
284
288
|
*/
|
|
285
289
|
private bindContainerMethodHandlers;
|
|
286
290
|
private initHeaderBarsFacade;
|
|
291
|
+
private initBrandingFacade;
|
|
287
292
|
/**
|
|
288
293
|
* 订阅 iframe 侧 titleChange 事件,并在宿主设置了 headerBars.onTitleChange 时转发标题值。
|
|
289
294
|
* 输入:无。
|
|
@@ -291,9 +296,12 @@ export declare class OfficeSDK extends TinyEmitter {
|
|
|
291
296
|
*/
|
|
292
297
|
private ensureHeaderBarsTitleChangeSubscription;
|
|
293
298
|
private invokeHeaderBars;
|
|
299
|
+
private invokeBranding;
|
|
294
300
|
private syncHeaderBarsCommands;
|
|
295
301
|
private createHeaderBarsHost;
|
|
302
|
+
private createBrandingHost;
|
|
296
303
|
private applyHeaderBarsChanged;
|
|
304
|
+
private applyBrandingChanged;
|
|
297
305
|
private syncHeaderBarsVisible;
|
|
298
306
|
private setHeaderBarsVisible;
|
|
299
307
|
private getHeaderBarsCommandRef;
|
|
@@ -42,6 +42,8 @@ export type EditorFacadeContractAssertions = [
|
|
|
42
42
|
Assert<IsAssignable<NonNullable<OfficeSDK['charts']>['addChartFromSelection'], (params?: import('./OfficeSDK').AddChartFromSelectionParams) => Promise<AddChartFromSelectionResult | undefined>>>,
|
|
43
43
|
Assert<IsAssignable<PresentationSelection['getSelectedShapes'], (ids?: string[]) => Promise<PresentationShape[] | null>>>,
|
|
44
44
|
Assert<IsAssignable<NonNullable<OfficeSDK['zoom']>['setPercentage'], (percentage: number) => Promise<void>>>,
|
|
45
|
-
Assert<IsAssignable<NonNullable<OfficeSDK['eventSubscription']>['addLoadedListener'], (listener: () => void) => () => void
|
|
45
|
+
Assert<IsAssignable<NonNullable<OfficeSDK['eventSubscription']>['addLoadedListener'], (listener: () => void) => () => void>>,
|
|
46
|
+
Assert<IsAssignable<OfficeSDK['branding']['getEditorFooterLogo'], () => Promise<import('./OfficeSDK').SDKBrandConfig | undefined>>>,
|
|
47
|
+
Assert<IsAssignable<OfficeSDK['branding']['setEditorFooterLogoSrc'], (src: string) => Promise<void>>>
|
|
46
48
|
];
|
|
47
49
|
export {};
|