broccoli-node-api
v1.7.0
Published
Broccoli Plugin API Types
Downloads
1,379,158
Readme
broccoli-node-api
TypeScript types for the Broccoli Node Api
Exports
Node
type Node = TransformNode | SourceNode;
InputNode
type InputNode = Node | string;
NodeCommon
interface NodeCommon<T extends NodeInfo> {
__broccoliFeatures__: FeatureSet;
__broccoliGetInfo__: (builderFeatures: FeatureSet) => T;
}
NodeMap
interface NodeMap = {
transform: TransformNode;
source: SourceNode;
};
TransformNode
interface TransformNode extends NodeCommon<TransformNodeInfo> {}
SourceNode
interface SourceNode extends NodeCommon<SourceNodeInfo> {}
FeatureSet
interface FeatureSet {
[feature: string]: boolean;
}
NodeInfo
type NodeInfo = TransformNodeInfo | SourceNodeInfo;
NodeType
type NodeType = "transform" | "source";
NodeInfoMap
interface NodeInfoMap = {
transform: TransformNodeInfo;
source: SourceNodeInfo;
};
NodeInfoCommon
interface NodeInfoCommon<T extends NodeType> {
nodeType: T;
name: string;
annotation: string | null | undefined;
instantiationStack: string;
}
TransformNodeInfo
interface TransformNodeInfo extends NodeInfoCommon<"transform"> {
inputNodes: Node[];
setup(
features: FeatureSet,
options: { inputPaths: string[]; outputPath: string; cachePath: string }
): void;
getCallbackObject(): CallbackObject;
persistentOutput: boolean;
needsCache: boolean;
volatile: boolean;
trackInputChanges: boolean;
}
TransformNodeInfo Documentation
CallbackObject
interface CallbackObject {
build(buildChangeObject?: BuildChangeObject): Promise<void> | void;
}
BuildChangeObject
interface BuildChangeObject {
changedNodes: boolean[];
}
SourceNodeInfo
interface SourceNodeInfo extends NodeInfoCommon<"source"> {
sourceDirectory: string;
watched: boolean;
}