import { IInitInteractive, INavigationOptions, IAuthInfo, ISupportedFeatures, IShowModal, ICloseModal, IGetInteractiveListOptions, IGetInteractiveListResponse, ISetLinkedInteractives, IGetLibraryInteractiveListRequest, IJwtResponse, ICustomMessageHandler, ICustomMessagesHandledMap, IGetInteractiveSnapshotOptions, IGetInteractiveSnapshotResponse, IAddLinkedInteractiveStateListenerOptions, IDecoratedContentEvent, ITextDecorationHandler, WriteAttachmentParams, ReadAttachmentParams, GetAttachmentUrlParams, IGetReportItemAnswerHandler, IReportItemAnswer, OnUnloadFunction, IReportItemHandlerMetadata, ICustomMessage, IJobInfo, IFocusEnterMessage, FocusExitMode } from "./types"; import { PubSubChannel } from "./pubsub"; export { PubSubChannel }; export declare const getInitInteractiveMessage: () => Promise | null>; export declare const getMode: () => Promise<"runtime" | "authoring" | "report" | "reportItem" | undefined>; export declare const getInteractiveState: () => InteractiveState | null; export declare const setInteractiveStateTimeout = 2000; /** * Note that state will become frozen and should never be mutated. * Each time you update state, make sure that a new object is passed. * * Good: * ``` * setInteractiveState(Object.assign({}, previousState, {someProperty: "a new value"})); * // or * setInteractiveState({...previousState, someProperty: "a new value"}); * ``` * * Bad: * ``` * previousState.someProperty = "a new value"; * setInteractiveState(previousState); * ``` */ export declare const setInteractiveState: (newInteractiveState: InteractiveState | null) => void; /** * Useful in rare cases when it's not desirable to wait for the delayed state updates (at this point it only applies * to interactive state updates). Internally used by the showModal and closeModal functions, as opening modal * usually means reloading interactive. It's necessary to make sure that the state is up to date before it happens. */ export declare const flushStateUpdates: () => void; export declare const getAuthoredState: () => AuthoredState | null; /** * Note that state will become frozen and should never be mutated. * Each time you update state, make sure that a new object is passed. * * Good: * ``` * setAuthoredState(Object.assign({}, previousState, {someProperty: "a new value"})); * // or * setAuthoredState({...previousState, someProperty: "a new value"}); * ``` * * Bad: * ``` * previousState.someProperty = "a new value"; * setAuthoredState(previousState); * ``` */ export declare const setAuthoredState: (newAuthoredState: AuthoredState | null) => void; export declare const getGlobalInteractiveState: () => GlobalInteractiveState | null; /** * Note that state will become frozen and should never be mutated. * Each time you update state, make sure that a new object is passed. * * Good: * ``` * setGlobalInteractiveState(Object.assign({}, previousState, {someProperty: "a new value"})); * // or * setGlobalInteractiveState({...previousState, someProperty: "a new value"}); * ``` * * Bad: * ``` * previousState.someProperty = "a new value"; * setGlobalInteractiveState(previousState); * ``` */ export declare const setGlobalInteractiveState: (newGlobalState: GlobalInteractiveState | null) => void; export declare const addCustomMessageListener: (callback: ICustomMessageHandler, handles?: ICustomMessagesHandledMap | undefined) => void; export declare const removeCustomMessageListener: () => boolean; export declare const addFocusEnterListener: (callback: (mode: IFocusEnterMessage["mode"]) => void) => void; export declare const removeFocusEnterListener: () => boolean; export declare const sendFocusExit: (mode: FocusExitMode) => void; export declare const addDecorateContentListener: (callback: ITextDecorationHandler) => void; export declare const removeDecorateContentListener: () => void; export declare const addGetReportItemAnswerListener: (callback: IGetReportItemAnswerHandler) => void; export declare const removeGetReportItemAnswerListener: () => void; export declare const notifyReportItemClientReady: (metadata?: IReportItemHandlerMetadata | undefined) => void; export declare const setSupportedFeatures: (features: ISupportedFeatures) => void; export declare const setHeight: (height: number | string) => void; export declare const postDecoratedContentEvent: (msg: IDecoratedContentEvent) => void; /** * Providing empty string or null disables hint. */ export declare const setHint: (hint: string | null) => void; export declare const setNavigation: (options: INavigationOptions) => void; export declare const getAuthInfo: () => Promise; export declare const getFirebaseJwt: (firebaseApp: string) => Promise; export declare const log: (action: string, data?: object | undefined) => void; export declare const addInteractiveStateListener: (listener: (interactiveState: InteractiveState) => void) => void; export declare const removeInteractiveStateListener: (listener: (interactiveState: InteractiveState) => void) => void; export declare const addAuthoredStateListener: (listener: (authoredState: AuthoredState) => void) => void; export declare const removeAuthoredStateListener: (listener: (authoredState: AuthoredState) => void) => void; export declare const addGlobalInteractiveStateListener: (listener: (globalInteractiveState: GlobalInteractiveState) => void) => void; export declare const removeGlobalInteractiveStateListener: (listener: (globalInteractiveState: GlobalInteractiveState) => void) => void; /** * The listener should be called immediately after it is added with any state of the linked * interactive that the host currently knows about. This first call might not happen * synchronously it could be slightly delayed. And then the listener should be called again * whenever the state of the linked interactive changes. */ export declare const addLinkedInteractiveStateListener: (listener: (linkedIntState: LinkedInteractiveState | undefined) => void, options: IAddLinkedInteractiveStateListenerOptions) => void; export declare const removeLinkedInteractiveStateListener: (listener: (intState: InteractiveState | null) => void) => void; /** * "lightbox" type is used for displaying images or generic iframes (e.g. help page, but NOT dynamic interactives). * "dialog" is used for showing dynamic interactives. It'll be initialized correctly by the host environment and * all the runtime features will be supported. */ export declare const showModal: (options: IShowModal) => void; export declare const closeModal: (options: ICloseModal) => void; export declare const getInteractiveList: (options: IGetInteractiveListOptions) => Promise; export declare const setLinkedInteractives: (options: ISetLinkedInteractives) => void; export declare const getInteractiveSnapshot: (options: IGetInteractiveSnapshotOptions) => Promise; /** * @todo Implement this function. */ export declare const getLibraryInteractiveList: (options: IGetLibraryInteractiveListRequest) => void; export declare const writeAttachment: (params: WriteAttachmentParams) => Promise; export declare const readAttachment: (params: ReadAttachmentParams) => Promise; export declare const getAttachmentUrl: (params: GetAttachmentUrlParams) => Promise; export declare const sendReportItemAnswer: (request: Omit) => void; export declare const setOnUnload: (onUnload?: OnUnloadFunction<{}> | undefined) => void; export declare const sendCustomMessage: (customMessage: ICustomMessage) => void; export declare const createPubSubChannel: (channelId: string, channelInfo?: any) => PubSubChannel; export declare const setDirtyState: (isDirty: boolean) => void; export declare const createJob: (request: { task: string; } & Record) => Promise; export declare const cancelJob: (jobId: string) => void; export declare const getJobs: () => IJobInfo[]; export declare const addJobUpdateListener: (listener: (job: IJobInfo) => void) => void; export declare const removeJobUpdateListener: (listener: (job: IJobInfo) => void) => void;