@codama/renderers-js
Version:
JavaScript renderer compatible with the Solana Kit library
25 lines • 1.42 kB
TypeScript
import { ConfigureOptions } from 'nunjucks';
import { ImportMap } from '../ImportMap';
export declare function fragment(render: string, imports?: ImportMap): Fragment;
export declare function fragmentFromTemplate(fragmentFile: string, context?: object, options?: ConfigureOptions): Fragment;
export declare function mergeFragments(fragments: Fragment[], mergeRenders: (renders: string[]) => string): Fragment;
export declare class Fragment {
render: string;
imports: ImportMap;
features: Set<FragmentFeature>;
constructor(render: string, imports?: ImportMap, features?: Set<FragmentFeature>);
setRender(render: string): this;
mapRender(fn: (render: string) => string): this;
addImports(module: string, imports: Set<string> | string[] | string): this;
removeImports(module: string, imports: Set<string> | string[] | string): this;
mergeImportsWith(...others: (Fragment | ImportMap)[]): this;
addImportAlias(module: string, name: string, alias: string): this;
addFeatures(features: FragmentFeature | FragmentFeature[]): this;
removeFeatures(features: FragmentFeature | FragmentFeature[]): this;
hasFeatures(features: FragmentFeature | FragmentFeature[]): boolean;
mergeFeaturesWith(...others: Fragment[]): this;
clone(): Fragment;
toString(): string;
}
export type FragmentFeature = 'instruction:resolverScopeVariable';
//# sourceMappingURL=common.d.ts.map