All files / packages/sds-metadata/src types.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106                                                                                                                                                                                                                   
import { Declaration, Rule } from "postcss";
 
 
/**
 * Interface for a selector processor
 */
export interface SelectorProcessor<T> {
  processSelector: (selector: string, rule: Rule) => void;
  getResults: () => T;
}
 
/**
 * Interface for a declaration processor
 */
export interface DeclarationProcessor<T> {
  processDeclaration: (declaration: Declaration) => void;
  getResults: () => T;
}
 
 
 
/**
 * Interface for a CSV row processor
 */
export interface CSVRowProcessor<T> {
  processRow: (row: string[]) => void;
  getResults: () => T;
} 
 
export interface StyleHooksRawJson{
  aliases?:any;
  props?:Record<string, StylingHookRawData>
}
 
/* 
  Interface for a styling hook raw data
*/
export interface StylingHookRawData {
  name: string;
  value: string;
  scope: string;
  cssProperties: string[];
  type: string;
  namespace: string;
  category: string;
  comment: string;
  originalValue: string;
  syntax: string;
  group: string;
}
 
export interface HookValueByTheme {
  slds?: string;
  cosmos?: string;
}
 
/* 
  Interface for a styling hook metadata
*/
export interface StylingHookMetadata {
  aliases: HookValueByTheme;
  category: string;
  external: boolean;
  group: string;
  properties: string[];
  scope: string;
  values: HookValueByTheme;
}
 
export interface StylingHooksJsonByTheme{
  slds: Record<string, StylingHookRawData>;
  cosmos: Record<string, StylingHookRawData>;
}
 
export type ValueToStyleHookMap = Map<string, Array<{
  name: string;
  properties: string[];
  group?: string;
}>>;
 
 
// Icon metadata
export interface IconsRawJson {
  name: "action" | "custom" | "doctype" |"standard" | "utility";
  description: string;
  icons: Icon[];
}
 
export interface Icon {
  sprite: string;
  symbol: string;
  className: string;
  synonyms: string[];
  visible: boolean;
}
 
export interface IconsMetadata {
  [key: string]: Icon;
}
 
export type SLDSDeltaEntry = "SLDS Classes" | "Component Styling Hooks" | "Global Styling Hooks" | "Kinetics Styling Hooks" | "Selectors" | "Type"
export interface SLDSDelta {
  [key: string]: SLDSDeltaEntry
}
 
export type SupportedFileFormat = 'json' | 'csv' | 'yaml';