Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
"homepage": "https://github.com/yumi-team/meta-messenger.js",
"license": "AGPL-3.0-or-later",
"dependencies": {
"json-bigint": "^1.0.0",
"yumi-json-bigint": "^1.0.0",
"koffi": "^2.15.1",
"undici": "^7.20.0"
},
"devDependencies": {
"@types/json-bigint": "^1.0.4",
"@types/node": "^25.1.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
Expand Down
55 changes: 55 additions & 0 deletions src/json-bigint.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* meta-messenger.js
* Unofficial Meta Messenger Chat API for Node.js
*
* Copyright (c) 2026 Yumi Team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

declare module "yumi-json-bigint" {
export type JSONBigIntAction = "error" | "ignore" | "preserve";

export interface JSONBigIntOptions {
strict?: boolean;
storeAsString?: boolean;
alwaysParseAsBig?: boolean;
parseAsBigInt32?: boolean;
useNativeBigInt?: boolean;
protoAction?: JSONBigIntAction;
constructorAction?: JSONBigIntAction;
}

export interface JSONBigInt {
parse(text: string, reviver?: (key: string, value: unknown) => unknown): unknown;
stringify(
value: unknown,
replacer?: ((key: string, value: unknown) => unknown) | Array<string | number>,
space?: string | number,
): string;
}

export interface JSONBigIntStatic {
(options?: JSONBigIntOptions): JSONBigInt;
parse(text: string, reviver?: (key: string, value: unknown) => unknown): unknown;
stringify(
value: unknown,
replacer?: ((key: string, value: unknown) => unknown) | Array<string | number>,
space?: string | number,
): string;
}

const JSONBigInt: JSONBigIntStatic;
export default JSONBigInt;
}
2 changes: 1 addition & 1 deletion src/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

import JSONBig from "json-bigint";
import koffi from "koffi";
import JSONBig from "yumi-json-bigint";

// Configure json-bigint to use native BigInt
const JSONBigNative = JSONBig({ useNativeBigInt: true });
Expand Down