@lmc-eu/spirit-analytics
Version:
Analytic tools for Spirit Design System
94 lines (90 loc) • 2.71 kB
text/typescript
interface Instance {
importInfo?: {
imported: string;
local: string;
moduleName: string;
importType: string;
};
props: Record<string, string | number>;
propsSpread: boolean;
location: {
file: string;
start: {
line: number;
column: number;
};
};
}
interface Component {
instances: Instance[];
}
interface PropValue {
name: string;
used: number;
}
interface Prop {
name: string;
used: number;
values: PropValue;
}
interface Source {
url: string;
props: Array<{
name: string | null;
value: string | number | null;
}>;
}
interface OutputInstance {
instances: number;
sources: Source[];
category: string;
icon: boolean;
props: Prop;
isDeprecated: boolean;
}
type TrackedData = {
react: Record<string, OutputInstance>;
twig: Record<string, OutputInstance>;
};
interface ReactScannerConfig {
config: string;
configDir?: string;
crawlFrom: string;
startTime?: string;
method?: string;
exclude?: Array<string>;
}
interface RunnerConfig {
crawlFrom: string;
react: ReactScannerConfig;
twig: {
configFile?: string;
outputFile?: string;
coreComponentsPath?: string;
};
}
type ScannerType = 'react' | 'twig' | null;
type types_Component = Component;
type types_Instance = Instance;
type types_Prop = Prop;
type types_PropValue = PropValue;
type types_ReactScannerConfig = ReactScannerConfig;
type types_RunnerConfig = RunnerConfig;
type types_ScannerType = ScannerType;
type types_TrackedData = TrackedData;
declare namespace types {
export type { types_Component as Component, types_Instance as Instance, types_Prop as Prop, types_PropValue as PropValue, types_ReactScannerConfig as ReactScannerConfig, types_RunnerConfig as RunnerConfig, types_ScannerType as ScannerType, types_TrackedData as TrackedData };
}
interface ForEachComponentOptions {
componentName: string;
component: Component;
}
type ForEachComponentHandler = (options: ForEachComponentOptions) => void;
type Sorter = (component: Component) => unknown;
interface SpiritAdoptionProcessorOptions {
forEachComponent: (callback: ForEachComponentHandler) => unknown;
sortObjectKeysByValue: (arg0: unknown, arg1?: Sorter) => unknown;
output: (arg0: unknown, arg1: string) => void;
}
declare const spiritAdoptionProcessor: ({ forEachComponent, sortObjectKeysByValue, output, }: SpiritAdoptionProcessorOptions) => unknown;
export { type Instance as I, type RunnerConfig as R, type ScannerType as S, type SpiritAdoptionProcessorOptions as a, spiritAdoptionProcessor as s, types as t };