style_impl.d.ts 868 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @license
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. import '../environment/dev';
  6. /**
  7. * Sequence of CSS declarations safe to use in style contexts in an HTML
  8. * document or in DOM APIs.
  9. */
  10. export declare abstract class SafeStyle {
  11. private readonly brand;
  12. }
  13. /**
  14. * Builds a new `SafeStyle` from the given string, without enforcing
  15. * safety guarantees. This shouldn't be exposed to application developers, and
  16. * must only be used as a step towards safe builders or safe constants.
  17. */
  18. export declare function createStyle(style: string): SafeStyle;
  19. /**
  20. * Checks if the given value is a `SafeStyle` instance.
  21. */
  22. export declare function isStyle(value: unknown): value is SafeStyle;
  23. /**
  24. * Returns the string value of the passed `SafeStyle` object while ensuring it
  25. * has the correct type.
  26. */
  27. export declare function unwrapStyle(value: SafeStyle): string;