document.d.ts 867 B

12345678910111213141516171819202122
  1. /**
  2. * @license
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. import { SafeHtml } from '../../internals/html_impl';
  6. /**
  7. * write safely calls {@link Document.write} on the given {@link Document} with
  8. * the given {@link SafeHtml}.
  9. */
  10. export declare function write(doc: Document, text: SafeHtml): void;
  11. declare type ValueType<Cmd extends string> = Lowercase<Cmd> extends 'inserthtml' ? SafeHtml : SafeHtml | string;
  12. /**
  13. * Safely calls {@link Document.execCommand}. When command is insertHtml, a
  14. * SafeHtml must be passed in as value.
  15. */
  16. export declare function execCommand<Cmd extends string>(doc: Document, command: Cmd, value?: ValueType<Cmd>): boolean;
  17. /**
  18. * Safely calls {@link Document.execCommand}('insertHtml').
  19. * @deprecated Use safeDocument.execCommand.
  20. */
  21. export declare function execCommandInsertHtml(doc: Document, html: SafeHtml): boolean;
  22. export {};