@jspm/generator

    Interface Provider

    interface Provider {
        parseUrlPkg(
            this: ProviderContext,
            url: string,
        ):
            | ExactPackage
            | { pkg: ExactPackage; subpath: `./${string}`; layer: string };
        pkgToUrl(
            this: ProviderContext,
            pkg: ExactPackage,
            layer?: string,
        ): Promise<`${string}/`>;
        resolveLatestTarget(
            this: ProviderContext,
            target: LatestPackageTarget,
            layer: string,
            parentUrl: string,
            resolver: Resolver,
        ): Promise<ExactPackage>;
        ownsUrl(this: ProviderContext, url: string): boolean;
        resolveBuiltin(
            this: ProviderContext,
            specifier: string,
            env: string[],
        ): string | Install;
        getPackageConfig(
            this: ProviderContext,
            pkgUrl: string,
        ): Promise<PackageConfig>;
        getFileList(this: ProviderContext, pkgUrl: string): Promise<Set<string>>;
        download(
            this: ProviderContext,
            pkg: ExactPackage,
        ): Promise<Record<string, ArrayBuffer>>;
        publish(
            this: ProviderContext,
            pkg: ExactPackage,
            files: Record<string, string | ArrayBuffer>,
            importMap: ImportMap,
            imports: string[],
        ): Promise<DeployOutput>;
        auth(
            this: ProviderContext,
            options: {
                username?: string;
                verify?: (url: string, instructions: string) => void;
            },
        ): Promise<{ token: string }>;
        configure(this: ProviderContext, config: any): void;
        supportedLayers?: string[];
    }
    Index

    Methods

    • Publish a package to the provider This is an optional method that providers can implement to support package publishing

      Parameters

      • this: ProviderContext
      • pkg: ExactPackage
      • files: Record<string, string | ArrayBuffer>
      • importMap: ImportMap

        Optional import map to include with the publish

      • imports: string[]

      Returns Promise<DeployOutput>

    • Authenticate with the provider This is an optional method that providers can implement to support authentication

      Parameters

      • this: ProviderContext
      • options: { username?: string; verify?: (url: string, instructions: string) => void }

      Returns Promise<{ token: string }>

      A promise resolving to an authentication token

    Properties

    supportedLayers?: string[]
    MMNEPVFCICPMFPCPTTAAATR