1 module spasm.bindings.common; 2 3 import spasm.types; 4 @safe: 5 nothrow: 6 7 alias ArrayBufferView = SumType!(Int8Array, Int16Array, Int32Array, Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array, DataView); 8 alias BufferSource = SumType!(ArrayBufferView, ArrayBuffer); 9 struct DOMException { 10 nothrow: 11 JsHandle handle; 12 alias handle this; 13 this(Handle h) { 14 this.handle = JsHandle(h); 15 } 16 auto name()() { 17 return DOMException_name_Get(this.handle); 18 } 19 auto message()() { 20 return DOMException_message_Get(this.handle); 21 } 22 auto code()() { 23 return DOMException_code_Get(this.handle); 24 } 25 enum ushort INDEX_SIZE_ERR = 1; 26 enum ushort DOMSTRING_SIZE_ERR = 2; 27 enum ushort HIERARCHY_REQUEST_ERR = 3; 28 enum ushort WRONG_DOCUMENT_ERR = 4; 29 enum ushort INVALID_CHARACTER_ERR = 5; 30 enum ushort NO_DATA_ALLOWED_ERR = 6; 31 enum ushort NO_MODIFICATION_ALLOWED_ERR = 7; 32 enum ushort NOT_FOUND_ERR = 8; 33 enum ushort NOT_SUPPORTED_ERR = 9; 34 enum ushort INUSE_ATTRIBUTE_ERR = 10; 35 enum ushort INVALID_STATE_ERR = 11; 36 enum ushort SYNTAX_ERR = 12; 37 enum ushort INVALID_MODIFICATION_ERR = 13; 38 enum ushort NAMESPACE_ERR = 14; 39 enum ushort INVALID_ACCESS_ERR = 15; 40 enum ushort VALIDATION_ERR = 16; 41 enum ushort TYPE_MISMATCH_ERR = 17; 42 enum ushort SECURITY_ERR = 18; 43 enum ushort NETWORK_ERR = 19; 44 enum ushort ABORT_ERR = 20; 45 enum ushort URL_MISMATCH_ERR = 21; 46 enum ushort QUOTA_EXCEEDED_ERR = 22; 47 enum ushort TIMEOUT_ERR = 23; 48 enum ushort INVALID_NODE_TYPE_ERR = 24; 49 enum ushort DATA_CLONE_ERR = 25; 50 } 51 alias DOMTimeStamp = uint; 52 alias Function = Any delegate(Any); 53 alias VoidFunction = void delegate(); 54 55 56 extern (C) string DOMException_name_Get(Handle); 57 extern (C) string DOMException_message_Get(Handle); 58 extern (C) ushort DOMException_code_Get(Handle);