UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

25 lines (24 loc) 808 B
/** * Utility types and type guards */ import ts from "typescript"; import { ComponentRelation } from "./component.types"; import { FunctionData } from "./function.types"; export type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]; }; export type Mutable<T> = { -readonly [P in keyof T]: T[P]; }; export type RecursivePartial<T> = { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P]; }; export declare enum FileType { JavaScript = 0, TypeScript = 1, JSX = 2, TSX = 3 } export declare function isComponentRelation(obj: any): obj is ComponentRelation; export declare function isFunctionData(obj: any): obj is FunctionData; export type NodeVisitor = (node: ts.Node) => void;