UNPKG

@govtechsg/open-attestation

Version:
43 lines (42 loc) 3.47 kB
import { WrappedDocument as WrappedDocumentV2 } from "./2.0/types"; import { WrappedDocument as WrappedDocumentV3 } from "./3.0/types"; import { WrappedDocument, OpenAttestationDocument } from "./shared/@types/document"; import * as utils from "./shared/utils"; import * as v2 from "./2.0/types"; import { OpenAttestationDocument as OpenAttestationDocumentV2 } from "./__generated__/schema.2.0"; import * as v3 from "./3.0/types"; import { OpenAttestationDocument as OpenAttestationDocumentV3 } from "./__generated__/schema.3.0"; import { WrapDocumentOptionV2, WrapDocumentOptionV3 } from "./shared/@types/wrap"; import { SigningKey, SUPPORTED_SIGNING_ALGORITHM } from "./shared/@types/sign"; import { Signer } from "@ethersproject/abstract-signer"; /** * @deprecated will be removed in the next major release in favour of OpenAttestation v4.0 (more info: https://github.com/Open-Attestation/open-attestation/tree/alpha) */ export declare function __unsafe__use__it__at__your__own__risks__wrapDocument<T extends OpenAttestationDocumentV3>(data: T, options?: WrapDocumentOptionV3): Promise<WrappedDocumentV3<T>>; /** * @deprecated will be removed in the next major release in favour of OpenAttestation v4.0 (more info: https://github.com/Open-Attestation/open-attestation/tree/alpha) */ export declare function __unsafe__use__it__at__your__own__risks__wrapDocuments<T extends OpenAttestationDocumentV3>(dataArray: T[], options?: WrapDocumentOptionV3): Promise<WrappedDocumentV3<T>[]>; export declare function wrapDocument<T extends OpenAttestationDocumentV2>(data: T, options?: WrapDocumentOptionV2): WrappedDocumentV2<T>; export declare function wrapDocuments<T extends OpenAttestationDocumentV2>(dataArray: T[], options?: WrapDocumentOptionV2): WrappedDocumentV2<T>[]; export declare const validateSchema: (document: WrappedDocument<any>) => boolean; export declare function verifySignature<T extends WrappedDocument<OpenAttestationDocument>>(document: T): boolean; export declare function obfuscate<T extends OpenAttestationDocumentV2>(document: WrappedDocument<T>, fields: string[] | string): WrappedDocument<T>; export declare function obfuscate<T extends OpenAttestationDocumentV3>(document: WrappedDocument<T>, fields: string[] | string): WrappedDocument<T>; export declare const isSchemaValidationError: (error: any) => error is utils.SchemaValidationError; /** * @deprecated signing of v3 documents will be removed in the next major release in favour of OpenAttestation v4.0 (more info: https://github.com/Open-Attestation/open-attestation/tree/alpha) */ export declare function signDocument<T extends v3.OpenAttestationDocument>(document: v3.SignedWrappedDocument<T> | v3.WrappedDocument<T>, algorithm: SUPPORTED_SIGNING_ALGORITHM, keyOrSigner: SigningKey | Signer): Promise<v3.SignedWrappedDocument<T>>; export declare function signDocument<T extends v2.OpenAttestationDocument>(document: v2.SignedWrappedDocument<T> | v2.WrappedDocument<T>, algorithm: SUPPORTED_SIGNING_ALGORITHM, keyOrSigner: SigningKey | Signer): Promise<v2.SignedWrappedDocument<T>>; export { digestDocument } from "./2.0/digest"; export { digestCredential } from "./3.0/digest"; export { checkProof, MerkleTree } from "./shared/merkle"; export { obfuscate as obfuscateDocument }; export { utils }; export * from "./shared/@types/document"; export * from "./shared/@types/sign"; export * from "./shared/signer"; export { getData } from "./shared/utils"; export { v2 }; export { v3 };