-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typescript): refactored how types are published
resolves #119
- Loading branch information
Showing
32 changed files
with
59 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import type { GetRandomValuesFunction } from '../interfaces.d' | ||
import crypto from './webcrypto.js' | ||
|
||
const random: GetRandomValuesFunction = crypto.getRandomValues.bind(crypto) | ||
const random = crypto.getRandomValues.bind(crypto) | ||
|
||
export default random |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { randomFillSync } from 'crypto' | ||
import type { GetRandomValuesFunction } from '../interfaces.d' | ||
|
||
const random: GetRandomValuesFunction = randomFillSync | ||
|
||
export default random | ||
export default randomFillSync |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
export * from '../runtime/base64url.js' | ||
/* eslint-disable prefer-destructuring */ | ||
|
||
import * as base64url from '../runtime/base64url.js' | ||
|
||
/** | ||
* Utility function to encode a string or Uint8Array as a base64url string. | ||
* | ||
* @param input Value that will be base64url-encoded. | ||
*/ | ||
interface Base64UrlEncode { | ||
(input: Uint8Array | string): string | ||
} | ||
/** | ||
* Utility function to decode a base64url encoded string. | ||
* | ||
* @param input Value that will be base64url-decoded. | ||
*/ | ||
interface Base64UrlDecode { | ||
(input: Uint8Array | string): Uint8Array | ||
} | ||
|
||
export const encode: Base64UrlEncode = base64url.encode | ||
export const decode: Base64UrlDecode = base64url.decode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import random from '../runtime/random.js' | ||
import runtimeRandom from '../runtime/random.js' | ||
|
||
interface GetRandomValuesFunction { | ||
(array: Uint8Array): Uint8Array | ||
} | ||
|
||
const random: GetRandomValuesFunction = runtimeRandom | ||
export default random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"outDir": "../dist/types", | ||
"removeComments": false, | ||
"declaration": true, | ||
"emitDeclarationOnly": true | ||
} | ||
} |