diff --git a/base64/decode/decode.node.ts b/base64/decode/decode.node.ts index 47c3674dc45..62a8a15f504 100644 --- a/base64/decode/decode.node.ts +++ b/base64/decode/decode.node.ts @@ -1,5 +1,5 @@ namespace $ { - export function $mol_base64_decode_node(base64Str: string): Uint8Array { + export function $mol_base64_decode_node(base64Str: string): Uint8Array< ArrayBuffer > { base64Str = base64Str.replace( /-/g, '+' ).replace( /_/g, '/' ) diff --git a/base64/decode/decode.ts b/base64/decode/decode.ts index 761eec23994..0ac9c15c99d 100644 --- a/base64/decode/decode.ts +++ b/base64/decode/decode.ts @@ -1,5 +1,5 @@ namespace $ { - export function $mol_base64_decode(base64: string): Uint8Array { + export function $mol_base64_decode(base64: string): Uint8Array< ArrayBuffer > { throw new Error('Not implemented') } } diff --git a/base64/decode/decode.web.ts b/base64/decode/decode.web.ts index 30d5f9baf11..b895b3da682 100644 --- a/base64/decode/decode.web.ts +++ b/base64/decode/decode.web.ts @@ -1,6 +1,6 @@ namespace $ { - export function $mol_base64_decode_web(base64Str: string): Uint8Array { + export function $mol_base64_decode_web(base64Str: string): Uint8Array< ArrayBuffer > { return new Uint8Array($mol_dom_context.atob(base64Str).split('').map(c => c.charCodeAt(0))) } diff --git a/buffer/buffer.ts b/buffer/buffer.ts index 4151c5d830c..86e01f70433 100644 --- a/buffer/buffer.ts +++ b/buffer/buffer.ts @@ -1,11 +1,11 @@ namespace $ { - export class $mol_buffer extends DataView { + export class $mol_buffer extends DataView< ArrayBuffer > { static from< This extends typeof $mol_buffer >( this: This, - array: number | string | ArrayBufferView, + array: number | string | ArrayBufferView< ArrayBuffer >, ) { if( typeof array === 'number' ) array = new Uint8Array( array ) if( typeof array === 'string' ) array = $mol_base64_ae_decode( array ) diff --git a/crypto/key/key.ts b/crypto/key/key.ts index 4a0f8aa0a40..74c651ffef0 100644 --- a/crypto/key/key.ts +++ b/crypto/key/key.ts @@ -8,14 +8,14 @@ namespace $ { export class $mol_crypto_key extends $mol_buffer { - static from< This extends typeof $mol_crypto_key >( this: This, serial: number | string | ArrayBufferView ) { + static from< This extends typeof $mol_crypto_key >( this: This, serial: number | string | ArrayBufferView< ArrayBuffer > ) { if( typeof serial === 'string' ) { serial = new Uint8Array([ ... $mol_base64_url_decode( serial.slice( 0, 43 ) ), ... $mol_base64_url_decode( serial.slice( 43, 86 ) ), ... $mol_base64_url_decode( serial.slice( 86, 129 ) ), - ]) + ]) as Uint8Array< ArrayBuffer > } return super.from( serial ) as InstanceType< This >