@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
74 lines (73 loc) • 2.85 kB
text/typescript
import { Ed25519PublicJwk } from "./modules/kms/jwk/kty/okp/Ed25519PublicJwk.mjs";
import { Logger } from "./logger/Logger.mjs";
import { PublicJwk } from "./modules/kms/jwk/PublicJwk.mjs";
import "./modules/kms/index.mjs";
//#region src/types.d.ts
interface InitConfig {
logger?: Logger;
autoUpdateStorageOnStartup?: boolean;
/**
* Allow insecure http urls in places where this is usually required.
* Unsecure http urls may still be allowed in places where this is not checked (e.g. didcomm)
*
* For some flows this config option is set globally, which means that different agent configurations
* will fight for the configuration. It is meant as a local development option.
*
* Use with caution
*
* @default false
*/
allowInsecureHttpUrls?: boolean;
/**
* The allowed skew in seconds that should be allowed for validity time of a credentials and other signed
* objects (e.g. StatusList). Mobile devices especially can run a bit behind actual time, making validity
* checks fail based on a milliseconds / seconds.
*
* NOTE: this does currently only affects JWT based objects and credentials:
* - Token Status List
* - SD-JWT VC
* - W3C VCDM 1.1 and 2.0 with JWT/SD-JWT
*
* It does not cover
* - W3C VCDM 1.1 JSON-LD
* - mDOC
*
* @default 30
*/
validitySkewSeconds?: number;
}
type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
type JsonArray = Array<JsonValue>;
interface JsonObject {
[property: string]: JsonValue;
}
/**
* Create an exclusive or, setting the other params to 'never' which helps with
* type narrowing
*
* @example
* ```
* type Options = XOR<{ name: string }, { dateOfBirth: Date }>
*
* type Options =
* | { name: string; dateOfBirth?: never }
* | { name?: never; dateOfBirth: Date }
* ```
*/
type XOR<T, U> = (T & { [P in keyof Omit<U, keyof T>]?: never }) | (U & { [P in keyof Omit<T, keyof U>]?: never });
interface ResolvedDidCommService {
id: string;
serviceEndpoint: string;
recipientKeys: PublicJwk<Ed25519PublicJwk>[];
routingKeys: PublicJwk<Ed25519PublicJwk>[];
}
declare const isJsonObject: (value: unknown) => value is JsonObject;
type SingleOrArray<T> = T | T[];
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
type CanBePromise<T> = T | Promise<T>;
type NonEmptyArray<T> = [T, ...T[]];
declare function mapNonEmptyArray<U, M extends (item: U, index: number) => unknown>(array: NonEmptyArray<U>, mapFunction: M): NonEmptyArray<ReturnType<M>>;
declare function isNonEmptyArray<U>(array: U[]): array is NonEmptyArray<U>;
//#endregion
export { CanBePromise, InitConfig, JsonArray, JsonObject, JsonValue, NonEmptyArray, Optional, ResolvedDidCommService, SingleOrArray, XOR, isJsonObject, isNonEmptyArray, mapNonEmptyArray };
//# sourceMappingURL=types.d.mts.map