Skip to content

defineConfig

defineConfig(config): object

Defined in: src/config/define-config.ts:12

Identity helper for type-safe config authoring:

fast-classifier.config.ts
import { defineConfig } from 'fast-classifier/config'
export default defineConfig({ categories: [...], rules: [...] })

object[] = ...

{ accountCategory?: string; accountDomains?: string[]; automatedNamePattern?: string; brandNamePattern?: string; personalCategory?: string; personalDomains?: string[]; personalProviderDomains?: string[]; personalProviderPattern?: string; personalReplyExclusionPattern?: string; relayDomains?: string[]; } = detectionSchema

string = ...

string[] = ...

string = ...

regex source, case-insensitive, matched against the from ADDRESS

string = ...

regex source, case-insensitive, matched against address + display name

string = ...

string[] = ...

the user’s own domains — anything sent from them files as personal

string[] = ...

string = ...

regex source, case-insensitive: freemail providers (needs-action heuristic)

string = ...

regex source, case-insensitive: senders excluded from the needs-reply bonus

string[] = ...

string[] = ...

exact sender addresses that must never be swept (checked twice)

{ exclusionKeywords?: object[]; highKeywords?: object[]; label?: string; languages?: ("en" | "de")[]; personalNeedsReplyBonus?: number; threshold?: number; unreadBonus?: number; windowDays?: number; } = needsActionSchema

object[] = ...

when present, REPLACES the language packs entirely

object[] = ...

when present, REPLACES the language packs entirely

string = ...

("en" | "de")[] = ...

built-in keyword packs to enable — English-only by default

number = ...

number = ...

number = ...

number = ...

how far back to scan

{ batchDelayMs?: number; batchSize?: number; maxItems?: number; progressEvery?: number; stallBackoffMs?: number; stallLimit?: number; } = opsSchema

number = ...

number = ...

number = ...

number = ...

number = ...

number = ...

{ baseUrl?: string; type?: "jmap" | "mcp"; } = ...

string = ...

override endpoints (testing / self-hosted JMAP)

"jmap" | "mcp" = ...

({ address: string; category: string; kind: "sender"; } | { category: string; domain: string; kind: "domain"; } | { category: string; kind: "name"; onlyForDomains?: string[]; pattern: string; })[] = ...

{ after?: string; targetLabel?: string; textHeuristic?: string; } = sweepSchema

string = ...

string = ...

string = ...

full-text heuristic identifying bulk mail

optional categories?: object[]

optional detection?: object = detectionSchema

optional accountCategory?: string

optional accountDomains?: string[]

optional automatedNamePattern?: string

regex source, case-insensitive, matched against the from ADDRESS

optional brandNamePattern?: string

regex source, case-insensitive, matched against address + display name

optional personalCategory?: string

optional personalDomains?: string[]

the user’s own domains — anything sent from them files as personal

optional personalProviderDomains?: string[]

optional personalProviderPattern?: string

regex source, case-insensitive: freemail providers (needs-action heuristic)

optional personalReplyExclusionPattern?: string

regex source, case-insensitive: senders excluded from the needs-reply bonus

optional relayDomains?: string[]

optional keepList?: string[]

exact sender addresses that must never be swept (checked twice)

optional needsAction?: object = needsActionSchema

optional exclusionKeywords?: object[]

when present, REPLACES the language packs entirely

optional highKeywords?: object[]

when present, REPLACES the language packs entirely

optional label?: string

optional languages?: ("en" | "de")[]

built-in keyword packs to enable — English-only by default

optional personalNeedsReplyBonus?: number

optional threshold?: number

optional unreadBonus?: number

optional windowDays?: number

how far back to scan

optional ops?: object = opsSchema

optional batchDelayMs?: number

optional batchSize?: number

optional maxItems?: number

optional progressEvery?: number

optional stallBackoffMs?: number

optional stallLimit?: number

optional provider?: object

optional baseUrl?: string

override endpoints (testing / self-hosted JMAP)

optional type?: "jmap" | "mcp"

optional rules?: ({ address: string; category: string; kind: "sender"; } | { category: string; domain: string; kind: "domain"; } | { category: string; kind: "name"; onlyForDomains?: string[]; pattern: string; })[]

optional sweep?: object = sweepSchema

optional after?: string

optional targetLabel?: string

optional textHeuristic?: string

full-text heuristic identifying bulk mail