Generate type defs

This commit is contained in:
dancoffman 2022-11-03 22:35:09 -07:00
parent bbc90b7da1
commit 7668c4ffa4
No known key found for this signature in database
GPG Key ID: 47B1F53E36A9B3CC
6 changed files with 16 additions and 2 deletions

11
bindings/node.js/dist/dts/kzg.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
export declare type BLSFieldElement = Uint8Array;
export declare type KZGProof = Uint8Array;
export declare type KZGCommitment = Uint8Array;
export declare type Blob = Uint8Array;
export declare const FIELD_ELEMENTS_PER_BLOB: any;
export declare const BYTES_PER_FIELD: any;
export declare function loadTrustedSetup(filePath: string): void;
export declare function freeTrustedSetup(): void;
export declare function blobToKzgCommitment(blob: Blob): KZGCommitment;
export declare function computeAggregateKzgProof(blobs: Blob[]): KZGProof;
export declare function verifyAggregateKzgProof(blobs: Blob[], expectedKzgCommitments: KZGCommitment[], kzgAggregatedProof: KZGProof): boolean;

1
bindings/node.js/dist/dts/test.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -4,7 +4,7 @@
"description": "NodeJS bindings for C-KZG", "description": "NodeJS bindings for C-KZG",
"author": "Dan Coffman", "author": "Dan Coffman",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "dist/kzg.js",
"scripts": { "scripts": {
"clean": "node-gyp clean", "clean": "node-gyp clean",
"build": "node-gyp rebuild", "build": "node-gyp rebuild",

View File

@ -3,7 +3,7 @@ import typescript from "@rollup/plugin-typescript";
export default { export default {
input: "kzg.ts", input: "kzg.ts",
output: { output: {
file: "dist/index.js", dir: "dist",
format: "cjs", format: "cjs",
}, },
plugins: [typescript()], plugins: [typescript()],

View File

@ -1,5 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": true,
"declarationDir": "dist/dts",
"target": "esnext", "target": "esnext",
"esModuleInterop": true, "esModuleInterop": true,
"moduleResolution": "node", "moduleResolution": "node",