Broccoli Plugin API Types
npm install broccoli-node-apibroccoli-node-apiTypeScript types for the Broccoli Node Api
- broccoli-node-api
- Exports
- Node
- InputNode
- NodeCommon
- NodeMap
- TransformNode
- SourceNode
- FeatureSet
- NodeInfo
- NodeType
- NodeInfoMap
- NodeInfoCommon
- TransformNodeInfo
- CallbackObject
- SourceNodeInfo
``ts`
type Node = TransformNode | SourceNode;
---
`ts`
type InputNode = Node | string;
---
`ts`
interface NodeCommon
__broccoliFeatures__: FeatureSet;
__broccoliGetInfo__: (builderFeatures: FeatureSet) => T;
}
---
`ts`
interface NodeMap = {
transform: TransformNode;
source: SourceNode;
};
---
`ts`
interface TransformNode extends NodeCommon
---
`ts`
interface SourceNode extends NodeCommon
---
`ts`
interface FeatureSet {
[feature: string]: boolean;
}
---
`ts`
type NodeInfo = TransformNodeInfo | SourceNodeInfo;
---
`ts`
type NodeType = "transform" | "source";
---
`ts`
interface NodeInfoMap = {
transform: TransformNodeInfo;
source: SourceNodeInfo;
};
---
`ts`
interface NodeInfoCommon
nodeType: T;
name: string;
annotation: string | null | undefined;
instantiationStack: string;
}
---
`ts`
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
---
`ts`
interface CallbackObject {
build(buildChangeObject?: BuildChangeObject): Promise
}
---
`ts`
interface BuildChangeObject {
changedNodes: boolean[];
}
---
`ts``
interface SourceNodeInfo extends NodeInfoCommon<"source"> {
sourceDirectory: string;
watched: boolean;
}