@learncard/core 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/core.d.ts CHANGED
@@ -4675,6 +4675,10 @@ export declare type VerifyExtension = {
4675
4675
  verifyCredential: (credential: VC) => Promise<VerificationCheck>;
4676
4676
  };
4677
4677
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
4678
+ export declare type InitFunction<Args extends Record<string, any> | undefined = Record<string, any>, Config extends keyof LearnCardConfig = keyof LearnCardConfig, ReturnValue extends LearnCard<any, any> = LearnCard<any, any>> = {
4679
+ args: undefined extends Args ? Partial<Pick<LearnCardConfig, Config>> : Args & Partial<Pick<LearnCardConfig, Config>>;
4680
+ returnValue: ReturnValue;
4681
+ };
4678
4682
  export declare type Plugin<Name extends string, PublicMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4679
4683
  name?: Name;
4680
4684
  pluginMethods: {
@@ -4799,10 +4803,16 @@ export declare type LearnCardConfig = {
4799
4803
  defaultContents: any[];
4800
4804
  ethereumConfig: EthereumConfig;
4801
4805
  };
4806
+ export declare type EmptyWallet = InitFunction<undefined, "didkit", EmptyLearnCard>;
4807
+ export declare type WalletFromKey = InitFunction<{
4808
+ seed: string;
4809
+ }, keyof LearnCardConfig, LearnCard>;
4802
4810
  /** Generates an empty wallet with no key material */
4803
- export declare const emptyWallet: ({ didkit, }?: Partial<Pick<LearnCardConfig, "didkit">>) => Promise<EmptyLearnCard>;
4811
+ export declare const emptyWallet: ({ didkit }?: EmptyWallet["args"]) => Promise<EmptyWallet["returnValue"]>;
4804
4812
  /** Generates a LearnCard Wallet from a 64 character seed string */
4805
4813
  export declare const walletFromKey: (key: string, { ceramicIdx, didkit, defaultContents, ethereumConfig, }?: Partial<LearnCardConfig>) => Promise<LearnCard>;
4814
+ export declare function initLearnCard(config?: EmptyWallet["args"]): Promise<EmptyWallet["returnValue"]>;
4815
+ export declare function initLearnCard(config: WalletFromKey["args"]): Promise<WalletFromKey["returnValue"]>;
4806
4816
  export * from "@wallet/init";
4807
4817
  export { Wallet, Plugin } from "types/wallet";
4808
4818