Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow passing undefined wherever appropriate
  • Loading branch information
dontwanttothink committed Oct 3, 2025
commit f28291da25233d9feedabad9b0172f189b7fa36f
27 changes: 16 additions & 11 deletions src/lib/esnext.typedarrays.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
* @param options If provided, sets the alphabet and padding behavior used.
* @returns A base64-encoded string.
*/
toBase64(options?: {
alphabet?: "base64" | "base64url";
omitPadding?: boolean;
}): string;
toBase64(
options?: {
alphabet?: "base64" | "base64url" | undefined;
omitPadding?: boolean | undefined;
} | undefined,
Comment thread
dontwanttothink marked this conversation as resolved.
Outdated
): string;

/**
* Sets the `Uint8Array` from a base64-encoded string.
Expand All @@ -17,10 +19,13 @@ interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
* @throws {SyntaxError} If the input string contains characters outside the specified alphabet, or if the last
* chunk is inconsistent with the `lastChunkHandling` option.
*/
setFromBase64(string: string, options?: {
alphabet?: "base64" | "base64url";
lastChunkHandling?: "loose" | "strict" | "stop-before-partial";
}): {
setFromBase64(
string: string,
options?: {
alphabet?: "base64" | "base64url" | undefined;
lastChunkHandling?: "loose" | "strict" | "stop-before-partial" | undefined;
} | undefined,
): {
read: number;
written: number;
};
Expand Down Expand Up @@ -54,9 +59,9 @@ interface Uint8ArrayConstructor {
fromBase64(
string: string,
options?: {
alphabet?: "base64" | "base64url";
lastChunkHandling?: "loose" | "strict" | "stop-before-partial";
},
alphabet?: "base64" | "base64url" | undefined;
lastChunkHandling?: "loose" | "strict" | "stop-before-partial" | undefined;
} | undefined,
): Uint8Array<ArrayBuffer>;

/**
Expand Down