@pandacss/extractor
Advanced tools
Comparing version
@@ -1,2 +0,3 @@ | ||
import { Node, CallExpression, JsxOpeningElement, JsxSelfClosingElement, Expression, SourceFile, JsxAttribute, PropertyAssignment, ShorthandPropertyAssignment } from 'ts-morph'; | ||
import * as ts_morph from 'ts-morph'; | ||
import { Node, CallExpression, JsxOpeningElement, JsxSelfClosingElement, Expression, SourceFile, PropertyAssignment, ShorthandPropertyAssignment, JsxAttribute, Identifier, JsxSpreadAttribute } from 'ts-morph'; | ||
import { EvaluateOptions } from 'ts-evaluator'; | ||
@@ -49,2 +50,19 @@ | ||
getStack(): Node[]; | ||
getRange: () => { | ||
startPosition: number; | ||
startLineNumber: number; | ||
startColumn: number; | ||
endPosition: number; | ||
endLineNumber: number; | ||
endColumn: number; | ||
}; | ||
toJSON(): { | ||
type: Definition["type"]; | ||
value: any; | ||
node: string; | ||
stack: string[]; | ||
line: number; | ||
column: number; | ||
}; | ||
toString(): string; | ||
} | ||
@@ -178,6 +196,38 @@ declare class BoxNodeObject extends BoxNodeType$1<ObjectType> { | ||
isNumberLiteral(node: BoxNode | undefined): node is BoxNodeLiteral; | ||
hasValue: (node: BoxNode | undefined) => node is BoxNodeArray | BoxNodeObject | BoxNodeLiteral | BoxNodeMap; | ||
}; | ||
type MatchProp$1 = (prop: MatchFnPropArgs) => boolean; | ||
type MatchArg = (prop: MatchFnArgs & MatchFnArguments) => boolean; | ||
declare const extractCallExpressionArguments: (node: CallExpression, ctx: BoxContext, matchProp?: MatchProp$1, matchArg?: MatchArg) => BoxNodeArray; | ||
declare const extract: ({ ast, ...ctx }: ExtractOptions) => ExtractResultByName; | ||
declare function getDeclarationFor(node: Identifier, stack: Node[], ctx: BoxContext): ts_morph.FunctionDeclaration | ts_morph.VariableDeclaration | ts_morph.ParameterDeclaration | ts_morph.BindingElement | undefined; | ||
declare function findIdentifierValueDeclaration(identifier: Identifier, stack: Node[], ctx: BoxContext, visitedsWithStack?: WeakMap<Node, Node[]>): ReturnType<typeof getDeclarationFor> | undefined; | ||
declare const getNodeRange: (node: Node) => { | ||
startPosition: number; | ||
startLineNumber: number; | ||
startColumn: number; | ||
endPosition: number; | ||
endLineNumber: number; | ||
endColumn: number; | ||
}; | ||
type NodeRange = ReturnType<typeof getNodeRange>; | ||
declare const extractJsxAttribute: (jsxAttribute: JsxAttribute, ctx: BoxContext) => BoxNode | undefined; | ||
declare const extractJsxElementProps: (node: JsxOpeningElement | JsxSelfClosingElement, ctx: BoxContext) => { | ||
name: string; | ||
props: Map<string, BoxNode>; | ||
}; | ||
type MaybeBoxNodeReturn = BoxNode | undefined; | ||
declare function maybeBoxNode(node: Node, stack: Node[], ctx: BoxContext, matchProp?: (prop: MatchFnPropArgs) => boolean): MaybeBoxNodeReturn; | ||
declare const maybeIdentifierValue: (identifier: Identifier, _stack: Node[], ctx: BoxContext) => BoxNode; | ||
type MatchProp = (prop: MatchFnPropArgs | MatchPropArgs) => boolean; | ||
declare const extractJsxSpreadAttributeValues: (node: JsxSpreadAttribute, ctx: BoxContext, matchProp: MatchProp) => MaybeBoxNodeReturn; | ||
type BoxNodeType = BoxNode | BoxNode[] | undefined; | ||
@@ -201,2 +251,2 @@ type CacheMap = WeakMap<BoxNode, unknown>; | ||
export { BoxContext, BoxNode, BoxNodeArray, BoxNodeConditional, BoxNodeEmptyInitializer, BoxNodeLiteral, BoxNodeMap, BoxNodeObject, BoxNodeUnresolvable, ExtractOptions, ExtractResultByName, ExtractResultItem, ExtractedComponentInstance, ExtractedComponentResult, ExtractedFunctionInstance, ExtractedFunctionResult, PrimitiveType, Unboxed, box, extract, isBoxNode, unbox }; | ||
export { BoxContext, BoxNode, BoxNodeArray, BoxNodeConditional, BoxNodeEmptyInitializer, BoxNodeLiteral, BoxNodeMap, BoxNodeObject, BoxNodeUnresolvable, ExtractOptions, ExtractResultByName, ExtractResultItem, ExtractedComponentInstance, ExtractedComponentResult, ExtractedFunctionInstance, ExtractedFunctionResult, NodeRange, PrimitiveType, Unboxed, box, extract, extractCallExpressionArguments, extractJsxAttribute, extractJsxElementProps, extractJsxSpreadAttributeValues, findIdentifierValueDeclaration, isBoxNode, maybeBoxNode, maybeIdentifierValue, unbox }; |
{ | ||
"name": "@pandacss/extractor", | ||
"version": "0.0.2", | ||
"version": "0.3.0", | ||
"description": "The css extractor for css panda", | ||
@@ -21,3 +21,3 @@ "main": "dist/index.js", | ||
"ts-pattern": "4.3.0", | ||
"@pandacss/logger": "0.0.2" | ||
"@pandacss/logger": "0.3.0" | ||
}, | ||
@@ -24,0 +24,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
141217
5.99%3545
6.2%+ Added
- Removed
Updated