import { JupyterFrontEndPlugin } from '@jupyterlab/application'; import { ISecret, ISecretsConnector, ISecretsList, ISecretsManager } from './token'; import { ISignal } from '@lumino/signaling'; interface IOptions { showSecretFields?: boolean; } /** * The default secrets manager. */ export declare class SecretsManager implements ISecretsManager { /** * The secrets manager constructor. */ constructor(options: IOptions); /** * Set the connector to use with the manager. * * NOTE: * If several extensions try to set the connector, the manager will be locked. * This is to prevent misconfiguration of competing plugins or MITM attacks. */ setConnector(value: ISecretsConnector): void; /** * A promise that resolves when the connector is set. */ get ready(): Promise; /** * A promise that locks the connector access during storage. */ protected get storing(): Promise; /** * A signal emitting when the field visibility setting has changed. */ get fieldVisibilityChanged(): ISignal; /** * Get the visibility of the secret fields. */ get secretFieldsVisibility(): boolean; /** * Set the visibility of the secret fields. * The visibility cannot be set if it is locked (from page config). */ set secretFieldsVisibility(value: boolean); /** * Get a secret given its namespace and ID. */ get(token: symbol, namespace: string, id: string): Promise; /** * Set a secret given its namespace and ID. */ set(token: symbol, namespace: string, id: string, secret: ISecret): Promise; /** * List the secrets for a namespace as a ISecretsList. */ list(token: symbol, namespace: string): Promise; /** * Remove a secret given its namespace and ID. */ remove(token: symbol, namespace: string, id: string): Promise; /** * Attach an input to the secrets manager, with its namespace and ID values. * An optional callback function can be attached too, which be called when the input * is programmatically filled. */ attach(token: symbol, namespace: string, id: string, input: HTMLInputElement, callback?: (value: string) => void): Promise; /** * Detach the input previously attached with its namespace and ID. */ detach(token: symbol, namespace: string, id: string): Promise; /** * Detach all attached input for a namespace. */ detachAll(token: symbol, namespace: string): Promise; private _onInput; /** * Actually detach of an input. */ private _detach; private _ready; private _storing; private _fieldsVisibilityChanged; } /** * The secrets manager namespace. */ export declare namespace SecretsManager { /** * A function that protects the secrets namespace of the signed plugin from * other plugins. * * @param id - the secrets namespace, which must match the plugin ID to prevent an * extension to use an other extension namespace. * @param factory - a plugin factory, taking a symbol as argument and returning a * plugin. * @returns - the plugin to activate. */ function sign(id: string, factory: ISecretsManager.PluginFactory): JupyterFrontEndPlugin; } export {};