first commit
This commit is contained in:
16
packages/shared/package.json
Normal file
16
packages/shared/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "@basil/shared",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared TypeScript types and utilities for Basil",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc --watch"
|
||||
},
|
||||
"keywords": ["basil", "shared", "types"],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
1
packages/shared/src/index.ts
Normal file
1
packages/shared/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './types';
|
||||
69
packages/shared/src/types.ts
Normal file
69
packages/shared/src/types.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
export interface Recipe {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
ingredients: Ingredient[];
|
||||
instructions: Instruction[];
|
||||
prepTime?: number; // minutes
|
||||
cookTime?: number; // minutes
|
||||
totalTime?: number; // minutes
|
||||
servings?: number;
|
||||
imageUrl?: string;
|
||||
images?: string[];
|
||||
sourceUrl?: string; // For imported recipes
|
||||
author?: string;
|
||||
cuisine?: string;
|
||||
category?: string;
|
||||
tags?: string[];
|
||||
rating?: number;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface Ingredient {
|
||||
id?: string;
|
||||
name: string;
|
||||
amount?: string;
|
||||
unit?: string;
|
||||
notes?: string;
|
||||
order: number;
|
||||
}
|
||||
|
||||
export interface Instruction {
|
||||
id?: string;
|
||||
step: number;
|
||||
text: string;
|
||||
imageUrl?: string;
|
||||
}
|
||||
|
||||
export interface RecipeImportRequest {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface RecipeImportResponse {
|
||||
recipe: Partial<Recipe>;
|
||||
success: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface StorageConfig {
|
||||
type: 'local' | 's3';
|
||||
localPath?: string;
|
||||
s3Bucket?: string;
|
||||
s3Region?: string;
|
||||
s3AccessKey?: string;
|
||||
s3SecretKey?: string;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
data?: T;
|
||||
error?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
17
packages/shared/tsconfig.json
Normal file
17
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"lib": ["ES2020"],
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Reference in New Issue
Block a user