import { ChallengeService } from '../Challenge'; import { ActionResponse } from '@standardnotes/responses'; import { ItemManager } from '../Items/ItemManager'; import { SNActionsExtension, Action, DecryptedItemInterface, TransferPayload } from '@standardnotes/models'; import { DeprecatedHttpService } from '../Api/DeprecatedHttpService'; import { AbstractService, DeviceInterface, InternalEventBusInterface, AlertService, EncryptionService } from '@standardnotes/services'; type PayloadRequestHandler = (uuid: string) => TransferPayload | undefined; /** * The Actions Service allows clients to interact with action-based extensions. * Action-based extensions are mostly RESTful actions that can push a local value or * retrieve a remote value and act on it accordingly. * There are 4 action types: * `get`: performs a GET request on an endpoint to retrieve an item value, and merges the * value onto the local item value. For example, you can GET an item's older revision * value and replace the current value with the revision. * `render`: performs a GET request, and displays the result in the UI. This action does not * affect data unless action is taken explicitely in the UI after the data is presented. * `show`: opens the action's URL in a browser. * `post`: sends an item's data to a remote service. This is used for example by Listed * to allow publishing a note to a user's blog. */ export declare class ActionsService extends AbstractService { private itemManager; private alertService; private device; private httpService; private encryptionService; private challengeService; protected internalEventBus: InternalEventBusInterface; private previousPasswords; private payloadRequestHandlers; constructor(itemManager: ItemManager, alertService: AlertService, device: DeviceInterface, httpService: DeprecatedHttpService, encryptionService: EncryptionService, challengeService: ChallengeService, internalEventBus: InternalEventBusInterface); deinit(): void; addPayloadRequestHandler(handler: PayloadRequestHandler): () => void; getExtensions(): SNActionsExtension[]; extensionsInContextOfItem(item: DecryptedItemInterface): SNActionsExtension[]; /** * Loads an extension in the context of a certain item. * The server then has the chance to respond with actions that are * relevant just to this item. The response extension is not saved, * just displayed as a one-time thing. */ loadExtensionInContextOfItem(extension: SNActionsExtension, item: DecryptedItemInterface): Promise; runAction(action: Action, item: DecryptedItemInterface): Promise; private handleRenderAction; private payloadByDecryptingResponse; private promptForLegacyPassword; private handlePostAction; private handleShowAction; private outgoingPayloadForItem; private getPayloadFromRequestHandlers; } export {};