All TypeScript contracts in Nubisco UI — props, options, enums — live in dedicated .d.ts files. Never inline a type, interface or enum inside a .vue file.
Naming prefixes
Three prefixes make it immediately clear what a symbol is before you look it up:
| Prefix | Meaning | Example |
|---|---|---|
I | Interface — describes the shape of an object | ISliderProps, IWithMessages |
E | Enum — a fixed set of named string or numeric values | ESize, EVariant |
T | Type alias — a union, intersection, or primitive alias | TActiveHandle, TJsonValue |
This convention applies everywhere: shared types, component types, and documentation-only imports.
Where types live
Types are placed based on how widely they are shared:
src/
types/ ← shared across multiple components
Props.d.ts — base interfaces for all input components
Size.d.ts — ESize, ESizeShort, ESizePixel enums
Variants.d.ts — EVariant enum
Option.d.ts — IOption, IOptionGroup
Decoration.d.ts
components/
Slider.vue
Slider.d.ts ← types used only by Slider
Select.vue
Select.d.ts ← types used only by SelectThe rule: if two or more components share a type, it belongs in src/types/. If only one component uses it, it lives adjacent to that component as ComponentName.d.ts.
Exports
Always use explicit named exports. No default exports, no re-exporting from index files unless intentional.
ts
// ✓ correct
export { ESize, ESizeShort }
// ✗ avoid
export default ESize