refactor progress
This commit is contained in:
12
packages/hono_types/package.json
Normal file
12
packages/hono_types/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@fluxer/hono_types",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"typecheck": "tsgo --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript/native-preview": "catalog:"
|
||||
}
|
||||
}
|
||||
35
packages/hono_types/src/HonoTypes.tsx
Normal file
35
packages/hono_types/src/HonoTypes.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export interface ErrorI18nService {
|
||||
getMessage(
|
||||
key: string,
|
||||
locale: string | null | undefined,
|
||||
variables?: Record<string, unknown>,
|
||||
fallbackMessage?: string,
|
||||
): string;
|
||||
}
|
||||
|
||||
export interface BaseHonoEnv {
|
||||
Variables: {
|
||||
errorI18nService?: ErrorI18nService;
|
||||
requestLocale?: string;
|
||||
requestId?: string;
|
||||
};
|
||||
}
|
||||
24
packages/hono_types/src/MetricsTypes.tsx
Normal file
24
packages/hono_types/src/MetricsTypes.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export interface MetricsCollector {
|
||||
recordCounter(metric: {name: string; value: number; labels?: Record<string, string>}): void;
|
||||
recordHistogram(metric: {name: string; value: number; labels?: Record<string, string>}): void;
|
||||
recordGauge(metric: {name: string; value: number; labels?: Record<string, string>}): void;
|
||||
}
|
||||
27
packages/hono_types/src/TracingTypes.tsx
Normal file
27
packages/hono_types/src/TracingTypes.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export interface TracingOptions {
|
||||
enabled?: boolean;
|
||||
skipPaths?: Array<string>;
|
||||
serviceName?: string;
|
||||
withSpan?: (name: string, fn: () => Promise<void>) => Promise<void>;
|
||||
setSpanAttributes?: (attributes: Record<string, string | number | boolean>) => void;
|
||||
attachTraceparent?: boolean;
|
||||
}
|
||||
5
packages/hono_types/tsconfig.json
Normal file
5
packages/hono_types/tsconfig.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfigs/package.json",
|
||||
"compilerOptions": {},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
Reference in New Issue
Block a user