Commit ed47352 jin
committed
1 parent 0bdc5ea commit ed47352 Copy full SHA for ed47352
File tree 5 files changed +7
-7
lines changed
5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
namespace $ {
2
- export function $mol_base64_decode_node ( base64Str : string ) : Uint8Array {
2
+ export function $mol_base64_decode_node ( base64Str : string ) : Uint8Array < ArrayBuffer > {
3
3
4
4
base64Str = base64Str . replace ( / - / g, '+' ) . replace ( / _ / g, '/' )
5
5
Original file line number Diff line number Diff line change 1
1
namespace $ {
2
- export function $mol_base64_decode ( base64 : string ) : Uint8Array {
2
+ export function $mol_base64_decode ( base64 : string ) : Uint8Array < ArrayBuffer > {
3
3
throw new Error ( 'Not implemented' )
4
4
}
5
5
}
Original file line number Diff line number Diff line change 1
1
namespace $ {
2
2
3
- export function $mol_base64_decode_web ( base64Str : string ) : Uint8Array {
3
+ export function $mol_base64_decode_web ( base64Str : string ) : Uint8Array < ArrayBuffer > {
4
4
return new Uint8Array ( $mol_dom_context . atob ( base64Str ) . split ( '' ) . map ( c => c . charCodeAt ( 0 ) ) )
5
5
}
6
6
Original file line number Diff line number Diff line change 1
1
namespace $ {
2
- export class $mol_buffer extends DataView {
2
+ export class $mol_buffer extends DataView < ArrayBuffer > {
3
3
4
4
static from <
5
5
This extends typeof $mol_buffer
6
6
> (
7
7
this : This ,
8
- array : number | string | ArrayBufferView ,
8
+ array : number | string | ArrayBufferView < ArrayBuffer > ,
9
9
) {
10
10
if ( typeof array === 'number' ) array = new Uint8Array ( array )
11
11
if ( typeof array === 'string' ) array = $mol_base64_ae_decode ( array )
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ namespace $ {
8
8
9
9
export class $mol_crypto_key extends $mol_buffer {
10
10
11
- static from < This extends typeof $mol_crypto_key > ( this : This , serial : number | string | ArrayBufferView ) {
11
+ static from < This extends typeof $mol_crypto_key > ( this : This , serial : number | string | ArrayBufferView < ArrayBuffer > ) {
12
12
13
13
if ( typeof serial === 'string' ) {
14
14
serial = new Uint8Array ( [
15
15
... $mol_base64_url_decode ( serial . slice ( 0 , 43 ) ) ,
16
16
... $mol_base64_url_decode ( serial . slice ( 43 , 86 ) ) ,
17
17
... $mol_base64_url_decode ( serial . slice ( 86 , 129 ) ) ,
18
- ] )
18
+ ] ) as Uint8Array < ArrayBuffer >
19
19
}
20
20
21
21
return super . from ( serial ) as InstanceType < This >
You can’t perform that action at this time.
0 commit comments