@livetronics/pipesurf-types
v1.1.15
Published
Shared TypeScript types for PipeSurf applications
Readme
@pipesurf/types
Shared TypeScript types for PipeSurf applications.
Installation
# From npm (when published)
npm install @pipesurf/types
# From local path (for development)
npm install ../packages/typesUsage
import type {
User,
Project,
ApiResponse,
CreateProjectRequest
} from '@pipesurf/types'
// Use in API calls
const response: ApiResponse<Project[]> = await fetch('/api/projects').then(
(res) => res.json()
)
// Use in forms
const newProject: CreateProjectRequest = {
code: 'PRJ-001',
name: 'New Pipeline Project',
clientName: 'Client Corp',
startDate: '2024-01-01',
endDate: '2024-12-31',
location: 'Houston, TX',
phases: ['FIT_UP', 'WELDING', 'NDT']
}
// Use in components
interface ProjectCardProps {
project: Project
onEdit?: (id: number) => void
}Available Types
Entities
User,Company,Project,ProjectPhaseWelder,WPS,WPSEntryDraft,DraftJoint,DraftSheet,DraftSpoolJoint,Sheet,SpoolMaterialGrade,WeldingProcess,WeldingCode,Schedule
Request/Response Types
ApiResponse<T>,PaginatedResponse<T>CreateUserRequest,UpdateUserRequestCreateProjectRequest,UpdateProjectRequestCreateWelderRequest,UpdateWelderRequestCreateWPSRequest,AddWPSEntriesRequestCreateEditDraftRequest,CreateDeleteDraftRequestSendOTPRequest,LoginViaOTPRequest,LoginResponse
Query Parameter Types
UsersQueryParams,ProjectsQueryParamsDraftsQueryParams,WeldersQueryParams,WPSQueryParams
Enums/Unions
UserRole,UserStatus,UserGenderProjectStatus,ProjectPhaseType,ProjectRoleDraftType,DraftStatusJointStatus,WelderStatus,CompanyStatusMaterialGradeType,MaterialCategory
Development
# Build the package
npm run build
# Watch mode
npm run dev
# Clean build artifacts
npm run cleanIntegration with React/React Native
This package is designed to be used with:
- pipesurf-web (React)
- pipesurf-mobile (React Native)
Types are compatible with:
- React Query / TanStack Query
- Axios / Fetch
- React Hook Form
- Zod (for runtime validation)
