换格式化器带来的差异,只有 5 个文件:长联合类型改成每项一行、以 | 开头。 和上一个提交分开,方便 blame 时跳过(git blame --ignore-rev)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
44295188b9
commit
572a818d49
5 files changed
+12
-5
No files matched your search
@@ -16,7 +16,8 @@ export const db = drizzle(client, { schema })
|
|||||||
* `$client`、`batch` 等)一并抹掉了。
|
* `$client`、`batch` 等)一并抹掉了。
|
||||||
*/
|
*/
|
||||||
export type DbOrTx =
|
export type DbOrTx =
|
||||||
typeof db | Parameters<Parameters<typeof db.transaction>[0]>[0]
|
| typeof db
|
||||||
|
| Parameters<Parameters<typeof db.transaction>[0]>[0]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读出来的时刻统一成 ISO 8601 UTC,和写侧的 `new Date().toISOString()` 同形状。
|
* 读出来的时刻统一成 ISO 8601 UTC,和写侧的 `new Date().toISOString()` 同形状。
|
||||||
|
|||||||
@@ -177,7 +177,8 @@ async function runJob<T>(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(stdout) as
|
const parsed = JSON.parse(stdout) as
|
||||||
{ ok: true; case?: CaseResult; display?: unknown } | SqlJobFailure
|
| { ok: true; case?: CaseResult; display?: unknown }
|
||||||
|
| SqlJobFailure
|
||||||
if (!parsed.ok) return parsed
|
if (!parsed.ok) return parsed
|
||||||
return { ok: true, value: (parsed.case ?? parsed.display) as T }
|
return { ok: true, value: (parsed.case ?? parsed.display) as T }
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import type { Exercise } from "utils/types"
|
import type { Exercise } from "utils/types"
|
||||||
|
|
||||||
export type Segment =
|
export type Segment =
|
||||||
{ type: "md"; content: string } | { type: "exercise"; exercise: Exercise }
|
| { type: "md"; content: string }
|
||||||
|
| { type: "exercise"; exercise: Exercise }
|
||||||
|
|
||||||
export function parseExercises(
|
export function parseExercises(
|
||||||
content: string,
|
content: string,
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ const POLL_INTERVAL = 3000
|
|||||||
const POLL_TIMEOUT = 3 * 60 * 1000
|
const POLL_TIMEOUT = 3 * 60 * 1000
|
||||||
|
|
||||||
type Outcome =
|
type Outcome =
|
||||||
{ ok: true; score: number; grade: string } | { ok: false; error?: string }
|
| { ok: true; score: number; grade: string }
|
||||||
|
| { ok: false; error?: string }
|
||||||
|
|
||||||
const { pause: pausePolling, resume: resumePolling } = useIntervalFn(
|
const { pause: pausePolling, resume: resumePolling } = useIntervalFn(
|
||||||
async () => {
|
async () => {
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ function handleForceLogout(reason: string) {
|
|||||||
* WebSocket 连接状态
|
* WebSocket 连接状态
|
||||||
*/
|
*/
|
||||||
export type ConnectionStatus =
|
export type ConnectionStatus =
|
||||||
"disconnected" | "connecting" | "connected" | "error"
|
| "disconnected"
|
||||||
|
| "connecting"
|
||||||
|
| "connected"
|
||||||
|
| "error"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocket 消息类型
|
* WebSocket 消息类型
|
||||||
|
|||||||
Reference in new issue
Block a user