Skip to content

Commit

Permalink
export types and fix links for typedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 10, 2023
1 parent e0f005a commit 7af4946
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export type Index = number & { [TYPE]: 'LRUCache Index' }
const isPosInt = (n: any): n is PosInt =>
n && n === Math.floor(n) && n > 0 && isFinite(n)

type UintArray = Uint8Array | Uint16Array | Uint32Array
type NumberArray = UintArray | number[]
export type UintArray = Uint8Array | Uint16Array | Uint32Array
export type NumberArray = UintArray | number[]

/* c8 ignore start */
// This is a little bit ridiculous, tbh.
Expand Down Expand Up @@ -129,8 +129,9 @@ class ZeroArray extends Array<number> {
this.fill(0)
}
}
export type { ZeroArray }

type StackLike = Stack | Index[]
export type StackLike = Stack | Index[]
class Stack {
heap: NumberArray
length: number
Expand Down Expand Up @@ -163,6 +164,7 @@ class Stack {
return this.heap[--this.length] as Index
}
}
export type { Stack }

/**
* Promise representing an in-progress {@link LRUCache#fetch} call
Expand All @@ -173,7 +175,7 @@ export type BackgroundFetch<V> = Promise<V | undefined> & {
__staleWhileFetching: V | undefined
}

type DisposeTask<K, V> = [
export type DisposeTask<K, V> = [
value: V,
key: K,
reason: LRUCache.DisposeReason
Expand Down Expand Up @@ -377,7 +379,7 @@ export namespace LRUCache {
* {@link OptionsBase.noDeleteOnFetchRejection},
* {@link OptionsBase.allowStaleOnFetchRejection},
* {@link FetchOptions.forceRefresh}, and
* {@link OptionsBase.context}
* {@link FetcherOptions.context}
*
* Any of these may be modified in the {@link OptionsBase.fetchMethod}
* function, but the {@link GetOptions} fields will of course have no
Expand Down

0 comments on commit 7af4946

Please sign in to comment.