reviewed.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * @license
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. import '../environment/dev';
  6. import { SafeHtml } from '../internals/html_impl';
  7. import { TrustedResourceUrl } from '../internals/resource_url_impl';
  8. import { SafeScript } from '../internals/script_impl';
  9. import { SafeStyle } from '../internals/style_impl';
  10. import { SafeStyleSheet } from '../internals/style_sheet_impl';
  11. /**
  12. * Performs a "reviewed conversion" to SafeHtml from a plain string that is
  13. * known to satisfy the SafeHtml type contract.
  14. *
  15. * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure
  16. * that the value of `html` satisfies the SafeHtml type contract in all
  17. * possible program states. An appropriate `justification` must be provided
  18. * explaining why this particular use of the function is safe.
  19. */
  20. export declare function htmlSafeByReview(html: string, justification: string): SafeHtml;
  21. /**
  22. * Performs a "reviewed conversion" to SafeScript from a plain string that
  23. * is known to satisfy the SafeScript type contract.
  24. *
  25. * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure
  26. * that the value of `script` satisfies the SafeScript type contract in
  27. * all possible program states. An appropriate `justification` must be provided
  28. * explaining why this particular use of the function is safe.
  29. */
  30. export declare function scriptSafeByReview(script: string, justification: string): SafeScript;
  31. /**
  32. * Performs a "reviewed conversion" to TrustedResourceUrl from a plain string
  33. * that is known to satisfy the SafeUrl type contract.
  34. *
  35. * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure
  36. * that the value of `url` satisfies the TrustedResourceUrl type
  37. * contract in all possible program states. An appropriate `justification` must
  38. * be provided explaining why this particular use of the function is safe.
  39. */
  40. export declare function resourceUrlSafeByReview(url: string, justification: string): TrustedResourceUrl;
  41. /**
  42. * Performs a "reviewed conversion" to SafeStyle from a plain string that is
  43. * known to satisfy the SafeStyle type contract.
  44. *
  45. * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure
  46. * that the value of `style` satisfies the SafeStyle type contract in all
  47. * possible program states. An appropriate `justification` must be provided
  48. * explaining why this particular use of the function is safe.
  49. */
  50. export declare function styleSafeByReview(style: string, justification: string): SafeStyle;
  51. /**
  52. * Performs a "reviewed conversion" to SafeStyleSheet from a plain string that
  53. * is known to satisfy the SafeStyleSheet type contract.
  54. *
  55. * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure
  56. * that the value of `stylesheet` satisfies the SafeStyleSheet type
  57. * contract in all possible program states. An appropriate `justification` must
  58. * be provided explaining why this particular use of the function is safe; this
  59. * may include a security review ticket number.
  60. */
  61. export declare function styleSheetSafeByReview(stylesheet: string, justification: string): SafeStyleSheet;