@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
171 lines (170 loc) • 4.64 kB
TypeScript
import { ExtensionRect } from './extension-rect';
import { ExtensionSearchOptions } from './extension-search-options';
/**
* Defines the payload for extension broker requests
*/
export declare type ExtensionBrokerRequestPayload = ExtensionBrokerCreateRequestPayload | ExtensionBrokerCallRequestPayload | ExtensionBrokerRunRequestPayload | ExtensionBrokerDestroyRequestPayload | ExtensionBrokerMoveRequestPayload | ExtensionBrokerFulfillTargetRequestPayload | ExtensionBrokerFindRequestPayload | ExtensionBrokerEmitRequestPayload | ExtensionBrokerListenRequestPayload;
export interface ExtensionMethodPayload {
/**
* The version of the method to call on the extension instance
*/
version: number;
/**
* The method to call on the extension instance
*/
method: string;
/**
* The arguments of used in 'call' to pass to the extension instance method.
*/
arguments?: any[];
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerCreateRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'create';
/**
* The id of the extension entry point to create.
*/
entryPointId: string;
/**
* The extension target we are creating this worker for
*/
extensionTarget?: string;
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerCallRequestPayload extends ExtensionMethodPayload {
/**
* The type of extension broker request
*/
requestType: 'call';
/**
* The id of the instance of an extension to call.
*/
instanceId: string;
/**
* Indicates the type of call we are trying to make ('worker" is assumed if not provided)
*/
callType?: 'worker' | 'service' | 'component';
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerRunRequestPayload extends ExtensionMethodPayload {
/**
* The type of extension broker request
*/
requestType: 'run';
/**
* Indicates if a return is expected from the run operation.
* For dialogs and short lived workers this will be true. For long running workers, it will be false.
*/
expectReturn?: boolean;
/**
* The id of the extension entry point to run.
*/
entryPointId: string;
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerDestroyRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'destroy';
/**
* The id of the instance of an extension to destroy
*/
instanceId: string;
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerEmitRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'emit';
/**
* The id of the instance of an extension that emitted the event
*/
instanceId: string;
/**
* String describing the type of event emitted that listeners have subscribed to
*/
eventType: string;
/**
* The data to emit
*/
data: any;
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerListenRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'listen';
/**
* The id of the instance of an extension to to listen to
*/
instanceId: string;
/**
* The type of even to listen to
* */
eventType: string;
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerMoveRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'move';
/**
* The id of the instance of an extension to destroy
*/
instanceId: string;
/**
* The rectangular position to move the extension to (relative to the iframe)
*/
rect: ExtensionRect;
/**
* The z-index to move to
*/
zIndex: number;
}
/**
* Defines the payload for extension broker requests
*/
export interface ExtensionBrokerFulfillTargetRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'fulfill';
/**
* The id of the extension target to fulfill
*/
extensionTargetId: string;
}
/**
* Defines the payload for extension broker find requests
*/
export interface ExtensionBrokerFindRequestPayload {
/**
* The type of extension broker request
*/
requestType: 'find';
/**
* The search options to find by.
*/
searchOptions: ExtensionSearchOptions;
}