Skip to content

broccolijs/broccoli-node-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

broccoli-node-api

TypeScript types for the Broccoli Node Api

Exports

Node

type Node = TransformNode | SourceNode;

Node Documentation


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;

NodeInfo Documentation


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;
}

SourceNodeInfo Documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published