prisma-util
Version:
Prisma Util is an easy to use tool that merges multiple Prisma schema files, allows extending of models, resolves naming conflicts both manually and automatically and provides easy access to Prisma commands and timing reports. It's mostly a plug-and-play
49 lines (48 loc) • 1.6 kB
TypeScript
/**
* A Feature is an extension that will be generated.
*/
export declare type Feature = {
identifier: string;
code: string;
};
/**
* Packages are the scope wrappers for extensions.
*/
export declare type Package = {
identifier: string;
features: Feature[];
};
/**
* Project Toolchain Extension API implementation.
*
* This class orchestrates extension generation and hashing and provides an unified API for using the generated code.
* It provides an easy way of creating extensions and correct scoping to make sure that Prisma Util users have a smooth experience.
*
* This API is intended for internal use only. You should not instantiate this class, but rather use the exported
* instance. ({@link ExtensionToolchainInstance})
*/
declare class ExtensionToolchain {
private processPromise?;
private packages;
constructor();
/**
* Add an extension to the current queue.
* @param pack The package name.
* @param name The name of this extension.
* @param code The code for this extension.
* @returns This instance for chaining.
*/
defineExtension(pack: string, name: string, code: string): this;
/**
* Generate all of the extensions that are currently in the queue.
*/
generate(): Promise<void>;
}
/**
* Instance of the Project Toolchain Extensions API Implementation.
*
* This is the entry-point to all extension creation, as it provides an unified interface for generating scoped
* extensions that are easy to use.
*/
export declare const ExtensionsToolchainInstance: ExtensionToolchain;
export {};