|
| 1 | +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file |
| 2 | +// for details. All rights reserved. Use of this source code is governed by a |
| 3 | +// BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +// Generated from Web IDL definitions. |
| 6 | + |
| 7 | +@JS() |
| 8 | +library; |
| 9 | + |
| 10 | +import 'dart:js_interop'; |
| 11 | + |
| 12 | +typedef HTMLString = String; |
| 13 | +typedef ScriptString = String; |
| 14 | +typedef ScriptURLString = String; |
| 15 | +typedef TrustedType = JSObject; |
| 16 | +typedef CreateHTMLCallback = JSFunction; |
| 17 | +typedef CreateScriptCallback = JSFunction; |
| 18 | +typedef CreateScriptURLCallback = JSFunction; |
| 19 | +extension type TrustedHTML._(JSObject _) implements JSObject { |
| 20 | + external static TrustedHTML fromLiteral(JSObject templateStringsArray); |
| 21 | + external String toJSON(); |
| 22 | +} |
| 23 | +extension type TrustedScript._(JSObject _) implements JSObject { |
| 24 | + external static TrustedScript fromLiteral(JSObject templateStringsArray); |
| 25 | + external String toJSON(); |
| 26 | +} |
| 27 | +extension type TrustedScriptURL._(JSObject _) implements JSObject { |
| 28 | + external static TrustedScriptURL fromLiteral(JSObject templateStringsArray); |
| 29 | + external String toJSON(); |
| 30 | +} |
| 31 | +extension type TrustedTypePolicyFactory._(JSObject _) implements JSObject { |
| 32 | + external TrustedTypePolicy createPolicy( |
| 33 | + String policyName, [ |
| 34 | + TrustedTypePolicyOptions policyOptions, |
| 35 | + ]); |
| 36 | + external bool isHTML(JSAny? value); |
| 37 | + external bool isScript(JSAny? value); |
| 38 | + external bool isScriptURL(JSAny? value); |
| 39 | + external String? getAttributeType( |
| 40 | + String tagName, |
| 41 | + String attribute, [ |
| 42 | + String elementNs, |
| 43 | + String attrNs, |
| 44 | + ]); |
| 45 | + external String? getPropertyType( |
| 46 | + String tagName, |
| 47 | + String property, [ |
| 48 | + String elementNs, |
| 49 | + ]); |
| 50 | + external TrustedHTML get emptyHTML; |
| 51 | + external TrustedScript get emptyScript; |
| 52 | + external TrustedTypePolicy? get defaultPolicy; |
| 53 | +} |
| 54 | +extension type TrustedTypePolicy._(JSObject _) implements JSObject { |
| 55 | + external TrustedHTML createHTML( |
| 56 | + String input, |
| 57 | + JSAny? arguments, |
| 58 | + ); |
| 59 | + external TrustedScript createScript( |
| 60 | + String input, |
| 61 | + JSAny? arguments, |
| 62 | + ); |
| 63 | + external TrustedScriptURL createScriptURL( |
| 64 | + String input, |
| 65 | + JSAny? arguments, |
| 66 | + ); |
| 67 | + external String get name; |
| 68 | +} |
| 69 | +extension type TrustedTypePolicyOptions._(JSObject _) implements JSObject { |
| 70 | + external factory TrustedTypePolicyOptions({ |
| 71 | + CreateHTMLCallback createHTML, |
| 72 | + CreateScriptCallback createScript, |
| 73 | + CreateScriptURLCallback createScriptURL, |
| 74 | + }); |
| 75 | + |
| 76 | + external set createHTML(CreateHTMLCallback value); |
| 77 | + external CreateHTMLCallback get createHTML; |
| 78 | + external set createScript(CreateScriptCallback value); |
| 79 | + external CreateScriptCallback get createScript; |
| 80 | + external set createScriptURL(CreateScriptURLCallback value); |
| 81 | + external CreateScriptURLCallback get createScriptURL; |
| 82 | +} |
0 commit comments