@nick-w3/types
v1.0.1
Published
Shared TypeScript types and interfaces for the Design System.
Downloads
14
Readme
@nick-w3/types
Shared TypeScript types and interfaces for the Design System.
Overview
This package contains centralized TypeScript type definitions used across the monorepo to ensure type consistency between packages and applications.
Structure
.
├── src/
│ ├── button.ts # Button component types
│ └── index.ts # Public type exports
│
├── tsconfig.json # TypeScript configuration
└── tsup.config.ts # Build configurationUsage
import { ButtonProps, ButtonSize, ButtonVariant } from "@nick-w3/types";
// Use in your components
interface MyButtonProps extends ButtonProps {
customProp?: string;
}
// Use type unions
type Size = ButtonSize; // 'sm' | 'md' | 'lg'
// Use variants
type Variant = ButtonVariant; // 'primary' | 'secondary' | 'ghost'Available Types
Component Props
ButtonProps: Props interface for button componentssize: Size variantsvariant: Style variants- Common button attributes
Common Types
- Size unions
- Variant unions
- Shared utility types
Development
# Build types
pnpm build
# Watch mode
pnpm dev
# Type checking
pnpm lintBuild
This package uses tsup for building, which provides:
- Type declaration file generation
- Clean builds
- Watch mode
- Tree-shaking
- CommonJS and ESM output
License
AGPL-3.0 - see the LICENSE file for details.
