/** Where the data is read from; each path replaces its lookup. */ export interface MagmaSettings { /** The directory the paths below are relative to, and the last place the packages are resolved from: the linted project by default. */ root?: string; /** The documentation.json of @maggioli-design-system/magma. */ documentation?: string; /** The dist/dtcg/base.tokens.json of @maggioli-design-system/design-tokens. */ tokens?: string; /** The dist/tailwind/consumption.json of @maggioli-design-system/styles. */ consumption?: string; /** The dist/dtcg/globals.tokens.json of @maggioli-design-system/styles. */ globals?: string; } export interface PropInfo { name: string; /** The attribute it reflects, when it has one. */ attr?: string; /** A boolean prop: on whenever its attribute is present. */ boolean: boolean; /** Every value it takes, when the type is a closed union of literals; undefined when open. */ values?: string[]; /** What to use instead, when the prop is deprecated (its `@deprecated` text). */ deprecation?: string; /** * The component changes it itself (Stencil's `mutable`): on a boolean, a state the component * moves through (`opened`, `visible`, `await`), not a choice of the markup (#1396). */ mutable?: true; /** A number (`duration`), which an attribute gives as text. */ number?: true; } export interface ComponentInfo { tag: string; /** Every prop, by its name and by its attribute. */ props: Map; /** The component renders a default slot. */ defaultSlot: boolean; } export interface StyleInfo { name: string; /** The components that document it. */ tags: string[]; /** Public: promised to the products. Internal: it may change in any release. */ visibility: 'public' | 'internal'; /** A public one that takes a value of its own (an illustration colour), not a token or a role. */ static: boolean; } export interface ThemeNames { /** The custom properties of the tokens: their own names and the Tailwind theme names they publish. */ properties: Set; /** The classes the theme makes: `-` of each token and keyword of a namespace, and the Magma utilities. */ classes: Set; } export interface PaletteInfo { /** The Tailwind utilities that take a colour (`bg`, `text`, `border-t`...), longest first. */ colorUtilities: string[]; /** The Tailwind keys of the raw palette steps (`tone-neutral-03`, `surface-neutral-default`). */ rawKeys: Set; } declare const PACKAGE: { documentation: string; tokens: string; consumption: string; globals: string; }; /** * The file of `kind`: the path of the settings; else, for the documentation, the one beside * these rules in the magma package; else the package resolved from these rules (magma's * dependencies, when they ship inside it); else resolved from the root, the linted project. */ export declare const locate: (kind: keyof typeof PACKAGE, settings?: MagmaSettings) => string; /** The version of the magma these rules ship in; undefined in the sources of the repository. */ export declare const shippedVersion: () => string | undefined; /** * A section of the lint guide at the release these rules ship in, its tag `magma@`: * a project on an older version reads the rule it runs, not the one on main. Main only from * the sources, which belong to no release. */ export declare const lintGuideUrl: (anchor: string, version?: string | undefined) => string; /** A data file as it is, parsed once per process: for the tools that need more than the rules. */ export declare const readData: (kind: keyof typeof PACKAGE, settings?: MagmaSettings) => T; /** The root of the installed magma package: two folders above its dist/documentation.json. */ export declare const magmaRoot: (settings?: MagmaSettings) => string; interface DocsValue { value?: string; type: string; } interface DocsProp { name: string; attr?: string; values?: DocsValue[]; deprecation?: string; mutable?: boolean; } export declare const propInfo: ({ name, attr, values, deprecation, mutable }: DocsProp) => PropInfo; /** The components of the installed version, by tag. */ export declare const loadComponents: (settings?: MagmaSettings) => Map; /** * The CSS custom properties the components document, by name. An entry without `visibility` * comes from a release before the contract (#1095), when every documented one was promised: * it reads as public. One documented by several components is public when any of them * promises it. */ export declare const loadStyles: (settings?: MagmaSettings) => Map; /** * The names a project writes from the theme of the installed version, from the consumption map * of styles: the custom property of every token and the Tailwind theme name it publishes; the * classes Tailwind makes from them, a utility of a namespace and the key of a token or a * keyword of that namespace (`gap-between-fields` from `--spacing-between-fields`), as * explain_class reads a class; and the utilities Magma writes itself (`text-title-h3`). The * carriers of a domain are checked against them (#1196). */ export declare const loadThemeNames: (settings?: MagmaSettings) => ThemeNames; /** * The custom properties of the tokens of the installed version, from their DTCG data: the `css` * of every token that is not internal, and the `css` of the `cssOnly` entries of a group (a * value with no DTCG type, `--magma-width-reading`: the README of design-tokens, "Token data"). * A role a utility or a component reads with no Tailwind theme variable (`--magma-width-page`) * is here and not in the consumption map; the carriers of a domain are checked against both. */ export declare const loadTokenNames: (settings?: MagmaSettings) => Set; /** The colour utilities and the raw palette keys of the installed version. */ export declare const loadPalette: (settings?: MagmaSettings) => PaletteInfo; export {};