weboffice-js-sdk 2.0.5-beta.14 → 2.0.5-beta.15
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/OfficeSDK.d.ts +5 -0
- package/dist/OfficeSDK.facade.types.d.ts +0 -5
- package/dist/OfficeSDK.methods.d.ts +67 -0
- package/dist/editorFacade.contract.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/jsapi/index.d.ts +1 -0
- package/dist/jsapi/public-methods.d.ts +15 -0
- package/package.json +1 -1
package/dist/OfficeSDK.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { EmptyPageOptions } from './types/EmptyPage';
|
|
|
10
10
|
import { BaseEditor } from './types/BaseEditor';
|
|
11
11
|
import { SlashMenuOptions } from './types/SlashMenu';
|
|
12
12
|
import type { CollaboratorFacade, CommentsFacade, ContentFacade, DiscussionFacade, DocsActiveOutlineFacade, DocsOutlineFacade, DocsSearchFacade, DocsSelectionFacade, DocsSettingsFacade, DocsSidebarFacade, DocsTablesFacade, ExternalAppFacade, HistoryFacade, LocksFacade, MentionFacade, OfficeSDKPresentationFacade, PresentationEventSubscriptionFacade, PresentationSelectionFacade, PresentationSlidesFacade, PresentationTextFacade, PresentationZoomFacade, SheetChartsFacade, SheetSelectionsFacade, SheetWorkbookFacade, SheetWorksheetFacade, TitleFacade, VersionFacade } from './OfficeSDK.facade.types';
|
|
13
|
+
import type { OfficeSDKMethodPath } from './OfficeSDK.methods';
|
|
13
14
|
import type { HeaderBarsFacade } from './OfficeSDK.headerBars';
|
|
14
15
|
export * from './OfficeSDK.facade.types';
|
|
15
16
|
export * from './OfficeSDK.headerBars';
|
|
@@ -39,6 +40,10 @@ export declare class OfficeSDK extends TinyEmitter {
|
|
|
39
40
|
spreadsheet?: Spreadsheet.Editor;
|
|
40
41
|
/** 当前轻文档的标准化、强类型文档入口。 */
|
|
41
42
|
ActiveOutline?: DocsActiveOutlineFacade;
|
|
43
|
+
/**
|
|
44
|
+
* 判断当前套件和 iframe runtime 是否支持指定的公开 SDK 方法。
|
|
45
|
+
*/
|
|
46
|
+
canIUse(method: OfficeSDKMethodPath): Promise<boolean>;
|
|
42
47
|
/**
|
|
43
48
|
* 当前套件支持的标题能力。
|
|
44
49
|
*/
|
|
@@ -52,15 +52,10 @@ export interface DocsProductEditorFacade {
|
|
|
52
52
|
}
|
|
53
53
|
export interface DocsActiveOutlineFacade {
|
|
54
54
|
Editor: DocsProductEditorFacade;
|
|
55
|
-
Reference: DocsProductReferenceFacade;
|
|
56
55
|
Service: DocsProductServiceFacade;
|
|
57
56
|
Sub: DocsProductSubFacade;
|
|
58
57
|
Env: DocsProductEnvFacade;
|
|
59
58
|
}
|
|
60
|
-
/** 轻文档产品引用能力。 */
|
|
61
|
-
export interface DocsProductReferenceFacade {
|
|
62
|
-
CanIUse: (scopes: string | string[]) => Promise<boolean>;
|
|
63
|
-
}
|
|
64
59
|
export interface DocsProductUserFacade {
|
|
65
60
|
GetUserInfo: () => Promise<unknown>;
|
|
66
61
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK capability method identifiers.
|
|
3
|
+
*
|
|
4
|
+
* Values are public SDK method paths. Keeping the object tree aligned with the
|
|
5
|
+
* public facade makes the accepted canIUse arguments discoverable without
|
|
6
|
+
* exposing product-specific API namespaces.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OfficeSDKMethods: {
|
|
9
|
+
readonly ActiveOutline: {
|
|
10
|
+
readonly Editor: {
|
|
11
|
+
readonly GetEditMode: "ActiveOutline.Editor.GetEditMode";
|
|
12
|
+
readonly Document: {
|
|
13
|
+
readonly GetContent: "ActiveOutline.Editor.Document.GetContent";
|
|
14
|
+
readonly GetTitleContent: "ActiveOutline.Editor.Document.GetTitleContent";
|
|
15
|
+
readonly SetTitleContent: "ActiveOutline.Editor.Document.SetTitleContent";
|
|
16
|
+
readonly Font: {
|
|
17
|
+
readonly SetTextColor: "ActiveOutline.Editor.Document.Font.SetTextColor";
|
|
18
|
+
readonly SetHighLightColor: "ActiveOutline.Editor.Document.Font.SetHighLightColor";
|
|
19
|
+
readonly SetBold: "ActiveOutline.Editor.Document.Font.SetBold";
|
|
20
|
+
readonly SetItalic: "ActiveOutline.Editor.Document.Font.SetItalic";
|
|
21
|
+
readonly SetUnderline: "ActiveOutline.Editor.Document.Font.SetUnderline";
|
|
22
|
+
readonly SetStrike: "ActiveOutline.Editor.Document.Font.SetStrike";
|
|
23
|
+
};
|
|
24
|
+
readonly Markdown: {
|
|
25
|
+
readonly GetMarkdown: "ActiveOutline.Editor.Document.Markdown.GetMarkdown";
|
|
26
|
+
readonly AppendMarkdown: "ActiveOutline.Editor.Document.Markdown.AppendMarkdown";
|
|
27
|
+
readonly InsertMarkdown: "ActiveOutline.Editor.Document.Markdown.InsertMarkdown";
|
|
28
|
+
readonly ValidateMarkdown: "ActiveOutline.Editor.Document.Markdown.ValidateMarkdown";
|
|
29
|
+
};
|
|
30
|
+
readonly Content: {
|
|
31
|
+
readonly ReplaceSelection: "ActiveOutline.Editor.Document.Content.ReplaceSelection";
|
|
32
|
+
readonly ReplaceAllContent: "ActiveOutline.Editor.Document.Content.ReplaceAllContent";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly Service: {
|
|
37
|
+
readonly User: {
|
|
38
|
+
readonly GetUserInfo: "ActiveOutline.Service.User.GetUserInfo";
|
|
39
|
+
};
|
|
40
|
+
readonly Permission: {
|
|
41
|
+
readonly GetDocumentPermission: "ActiveOutline.Service.Permission.GetDocumentPermission";
|
|
42
|
+
};
|
|
43
|
+
readonly Export: {
|
|
44
|
+
readonly DownloadDocument: "ActiveOutline.Service.Export.DownloadDocument";
|
|
45
|
+
};
|
|
46
|
+
readonly Collaboration: {
|
|
47
|
+
readonly GetSaveStatus: "ActiveOutline.Service.Collaboration.GetSaveStatus";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly Env: {
|
|
51
|
+
readonly Language: {
|
|
52
|
+
readonly GetLanguage: "ActiveOutline.Env.Language.GetLanguage";
|
|
53
|
+
};
|
|
54
|
+
readonly DocsMode: {
|
|
55
|
+
readonly GetDocsMode: "ActiveOutline.Env.DocsMode.GetDocsMode";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly Sub: {
|
|
59
|
+
readonly OnDocumentChange: "ActiveOutline.Sub.OnDocumentChange";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
type LeafValues<T> = T extends string ? T : T extends object ? {
|
|
64
|
+
[K in keyof T]: LeafValues<T[K]>;
|
|
65
|
+
}[keyof T] : never;
|
|
66
|
+
export type OfficeSDKMethodPath = LeafValues<typeof OfficeSDKMethods>;
|
|
67
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AddChartFromSelectionResult, BasicPresentationFacade, DocsActiveOutlineFacade, DocsEditorDeltaSnapshot, DocsRangeFacade, DocsRangeValue, DocsTableFacade, EditorTextFormat, OfficeSDK, PresentationFacade, PresentationSlideFacade, PresentationShape, PresentationShapeBase, PresentationTableCell, PresentationTableItem, PresentationTableRange, PresentationTableSelection, PresentationTextShape, PresentationTextRangeFacade, PresentationTextRangeValue, SheetRangeValue, SheetRangeFacade, SheetSelection } from './OfficeSDK';
|
|
2
|
+
import type { OfficeSDKMethodPath } from './OfficeSDK.methods';
|
|
2
3
|
type IsAssignable<T, U> = T extends U ? true : false;
|
|
3
4
|
type IsEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? (<V>() => V extends U ? 1 : 2) extends <V>() => V extends T ? 1 : 2 ? true : false : false;
|
|
4
5
|
type Assert<T extends true> = T;
|
|
@@ -11,6 +12,7 @@ type PresentationSelection = Extract<RootSelection, {
|
|
|
11
12
|
}>;
|
|
12
13
|
type RootPresentation = NonNullable<OfficeSDK['presentation']>;
|
|
13
14
|
export type EditorFacadeContractAssertions = [
|
|
15
|
+
Assert<IsEqual<OfficeSDK['canIUse'], (method: OfficeSDKMethodPath) => Promise<boolean>>>,
|
|
14
16
|
Assert<IsEqual<NonNullable<OfficeSDK['ActiveOutline']>, DocsActiveOutlineFacade>>,
|
|
15
17
|
Assert<IsEqual<DocsActiveOutlineFacade['Editor']['Document']['GetContent'], () => Promise<DocsEditorDeltaSnapshot>>>,
|
|
16
18
|
Assert<IsEqual<DocsActiveOutlineFacade['Editor']['Document']['Markdown']['AppendMarkdown'], (value: string) => Promise<DocsRangeValue>>>,
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from 'weboffice-js-sdk-shared';
|
|
|
10
10
|
export * from './connect';
|
|
11
11
|
export type { JSAPIAdapter, JSAPIContract, JSAPIContractCatalog, JSAPITransport } from './jsapi';
|
|
12
12
|
export * from './OfficeSDK';
|
|
13
|
+
export * from './OfficeSDK.methods';
|
|
13
14
|
export type { EmptyPageScene, EmptyPageOptions, EmptyPageActionOverride, EmptyPageContentOverride, NormalizedEmptyPageOptions, EmptyPageShownPayload, EmptyPageActionPayload, EmptyPageHiddenPayload, FileOpenFailedReason, TokenExpiredStrategy } from './types/EmptyPage';
|
|
14
15
|
export type { SlashMenuButton, SlashMenuEntry, SlashMenuOptions } from './types/SlashMenu';
|
|
15
16
|
export { ALL_EMPTY_PAGE_SCENES, normalizeEmptyPageOptions } from './types/EmptyPage';
|