handoff-app
Version:
Automated documentation toolchain for building client side documentation from figma
96 lines (95 loc) • 2.37 kB
TypeScript
import { Types as CoreTypes } from 'handoff-core';
import { SlotMetadata } from './transformers/preview/component';
import { type Filter } from './utils/filter';
export interface ValidationResult {
/**
* Description of what this validation check does
*/
description: string;
/**
* Whether the validation passed or failed
*/
passed: boolean;
/**
* Optional messages providing more details about the validation result
*/
messages?: string[];
/**
* Optional severity level of the validation result
*/
severity?: 'error' | 'warning' | 'info';
/**
* Optional timestamp of when the validation was performed
*/
timestamp?: string;
}
export interface ValidationResults {
[]: ValidationResult;
}
export interface ReferenceObject {
reference: string;
type: string;
name: string;
group: string;
}
export interface PreviewObject {
id: string;
title: string;
image: string;
description: string;
figma: string;
should_do: string[];
should_not_do: string[];
categories?: string[];
tags?: string[];
preview: string;
previews: {
[]: {
title: string;
values: {
[]: string;
};
url: string;
};
};
properties?: {
[]: SlotMetadata;
};
code: string;
html?: string;
format: string;
variant?: Record<string, string>;
options?: {
preview?: {
groupBy?: string;
filterBy?: Filter;
};
};
/**
* Validation results for the component
* Each key represents a validation type and the value contains detailed validation results
*/
validations?: Record<string, ValidationResult>;
}
export type PreviewJson = {
components: {
[]]: PreviewObject[];
};
};
export interface ComponentDocumentationOptions {
views?: {
[]: {
condition?: {
[]: ComponentViewFilterValue;
};
sort?: string[];
title?: string;
};
};
}
type ComponentViewFilterValue = string | string[] | {
[]: {
[]: string;
};
};
export {};