From 159ee8ddfc2fd367dc7b551afcbc893667fd5afd Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 5 Dec 2022 14:11:23 -0800 Subject: [PATCH] indexOfLine type --- packages/bun-types/bun.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index ea72c2a852..e4d95e7158 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -2929,6 +2929,16 @@ declare module "bun" { * "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2" */ export const revision: string; + + /** + * Find the index of a newline character in potentially ill-formed UTF-8 text. + * + * This is sort of like readline() except without the IO. + */ + export function indexOfLine( + buffer: ArrayBufferView | ArrayBufferLike, + offset?: number, + ): number; } type TypedArray =