export type OfficeScheme = 'ms-word' | 'ms-powerpoint' | 'ms-excel' | 'ms-visio' | 'ms-access' | 'ms-project' | 'ms-publisher' | 'ms-spd' | 'ms-infopath'; export type OfficeTemplateScheme = Exclude; export interface OfficeDocumentPayload { /** * Office URI scheme name registered by the target application. * * @example 'ms-word' */ scheme: Scheme; /** * URI location of the document to open. * * Microsoft documents document URIs as http or https based URIs. * * @example 'https://contoso.com/documents/report.docx' */ uri: string; } export interface OfficeAppDocumentPayload { /** * URI location of the document to open. * * Microsoft documents document URIs as http or https based URIs. * * @example 'https://contoso.com/documents/report.docx' */ uri: string; } export interface OfficeTemplatePayload { /** * Office URI scheme name registered by the target application. * * SharePoint Designer and InfoPath do not support the new-from-template command * in Microsoft's Office URI Schemes document. * * @example 'ms-powerpoint' */ scheme: Scheme; /** * URI location of the template file on which the new file will be based. * * @example 'https://contoso.com/templates/status.potx' */ templateUri: string; /** * Optional URI location of the folder in which the new document should be created. * * Microsoft requires this URI to point to the same host name as the template * URI when it is supplied. * * @example 'https://contoso.com/presentations/' */ saveLocation?: string; } export interface OfficeAppTemplatePayload { /** * URI location of the template file on which the new file will be based. * * @example 'https://contoso.com/templates/status.potx' */ templateUri: string; /** * Optional URI location of the folder in which the new document should be created. * * Microsoft requires this URI to point to the same host name as the template * URI when it is supplied. * * @example 'https://contoso.com/presentations/' */ saveLocation?: string; } export interface OfficeAppLauncher { openDocument(payload: OfficeAppDocumentPayload): string; openForEdit(payload: OfficeAppDocumentPayload): string; openForView(payload: OfficeAppDocumentPayload): string; } export interface OfficeTemplateAppLauncher extends OfficeAppLauncher { newFromTemplate(payload: OfficeAppTemplatePayload): string; } export declare function officeDocumentUrl(scheme: OfficeScheme, command: 'ofe' | 'ofv', uri: string): string; export declare function officeAbbreviatedUrl(scheme: OfficeScheme, uri: string): string; export declare function officeTemplateUrl(scheme: OfficeTemplateScheme, templateUri: string, saveLocation?: string): string; export declare function createOfficeApp(scheme: OfficeScheme): OfficeAppLauncher; export declare function createOfficeTemplateApp(scheme: OfficeTemplateScheme): OfficeTemplateAppLauncher;