Library
core
src
util
Readme

Lawtext core references


Lawtext core references / core/src/util

core/src/util

Classes

Type Aliases

Diff<T, U>

Diff<T, U>: T extends U ? never : T

Defined in: core/src/util/index.ts:50 (opens in a new tab)

Type Parameters

T

U


ResolvedType<T>

ResolvedType<T>: T extends PromiseLike<infer U> ? U : T

Defined in: core/src/util/index.ts:20 (opens in a new tab)

Type Parameters

T

Variables

pictMimeDict

const pictMimeDict: object

Defined in: core/src/util/index.ts:53 (opens in a new tab)

Type declaration

.bmp

readonly bmp: "image/bmp" = "image/bmp"

.gif

readonly gif: "image/gif" = "image/gif"

.jpeg

readonly jpeg: "image/jpeg" = "image/jpeg"

.jpg

readonly jpg: "image/jpeg" = "image/jpeg"

.pdf

readonly pdf: "application/pdf" = "application/pdf"

.png

readonly png: "image/png" = "image/png"

.svg

readonly svg: "image/svg+xml" = "image/svg+xml"

.tif

readonly tif: "image/tiff" = "image/tiff"

.tiff

readonly tiff: "image/tiff" = "image/tiff"

Functions

assertNever()

assertNever(x): never

Defined in: core/src/util/index.ts:46 (opens in a new tab)

Parameters

x

never

Returns

never


decodeBase64()

decodeBase64(base64): Uint8Array

Defined in: core/src/util/index.ts:33 (opens in a new tab)

Parameters

base64

string

Returns

Uint8Array


omit()

omit<T, K>(obj, ...keys): Omit<T, K>

Defined in: core/src/util/index.ts:27 (opens in a new tab)

Type Parameters

T

K extends string | number | symbol

Parameters

obj

T

keys

...K[]

Returns

Omit<T, K>


pick()

pick<T, K>(obj, ...keys): Pick<T, K>

Defined in: core/src/util/index.ts:22 (opens in a new tab)

Type Parameters

T

K extends string | number | symbol

Parameters

obj

T

keys

...K[]

Returns

Pick<T, K>


range()

range(start, end): Generator<number, void, unknown>

Defined in: core/src/util/index.ts:14 (opens in a new tab)

Parameters

start

number

end

number

Returns

Generator<number, void, unknown>


throttle()

throttle<TArgs>(func, waitms, initialWaitms?): (...args) => void

Defined in: core/src/util/index.ts:65 (opens in a new tab)

Type Parameters

TArgs extends unknown[]

Parameters

func

(...args) => unknown

waitms

number

initialWaitms?

number

Returns

Function

Parameters
args

...TArgs

Returns

void


throwError()

throwError(): never

Defined in: core/src/util/index.ts:42 (opens in a new tab)

Returns

never


wait()

wait(ms): Promise<void>

Defined in: core/src/util/index.ts:1 (opens in a new tab)

Parameters

ms

number

Returns

Promise<void>


withTime()

withTime<TArgs, TRet>(func): (...args) => Promise<[number, TRet]>

Defined in: core/src/util/index.ts:5 (opens in a new tab)

Type Parameters

TArgs extends unknown[]

TRet

Parameters

func

(...args) => TRet | Promise<TRet>

Returns

Function

Parameters
args

...TArgs

Returns

Promise<[number, TRet]>