tokens.ts 754 B

1234567891011121314151617181920212223242526
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { ReadonlyPartialJSONValue, Token } from '@lumino/coreutils';
  4. import { IDataConnector } from './interfaces';
  5. /* tslint:disable */
  6. /**
  7. * The default state database token.
  8. */
  9. export const IStateDB = new Token<IStateDB>('@jupyterlab/coreutils:IStateDB');
  10. /* tslint:enable */
  11. /**
  12. * The description of a state database.
  13. */
  14. export interface IStateDB<
  15. T extends ReadonlyPartialJSONValue = ReadonlyPartialJSONValue
  16. > extends IDataConnector<T> {
  17. /**
  18. * Return a serialized copy of the state database's entire contents.
  19. *
  20. * @returns A promise that bears the database contents as JSON.
  21. */
  22. toJSON(): Promise<{ [id: string]: T }>;
  23. }