UNPKG

@amjur/courts-db-ts

Version:

TypeScript port of the Python courts-db library for legal court identification

35 lines (34 loc) 1.55 kB
import { PCREUtils } from '@syntropiq/xtrax'; declare const escapeRegex: typeof PCREUtils.escapeRegex, substituteEdition: typeof PCREUtils.substituteEdition, substituteEditions: typeof PCREUtils.substituteEditions, getPCREPatternFromData: typeof PCREUtils.getPCREPatternFromData, convertNamedGroups: typeof PCREUtils.convertNamedGroups; import type { Courts, Court, CourtDict, CompiledRegexes, RegexVariables } from './types.js'; export declare const dbRoot: string; export { escapeRegex, substituteEdition, substituteEditions, getPCREPatternFromData, convertNamedGroups }; export declare const ordinals: string[]; /** * Load the courts database with proper variable processing */ export declare function loadCourtsDb(): Courts; /** * Load regex variables (now deprecated - use loadCourtsDb which includes processed variables) */ export declare function loadRegexVariables(): RegexVariables; /** * Create a dictionary mapping court IDs to court objects */ export declare function makeCourtDictionary(courts: Courts): CourtDict; /** * Compile all regex patterns for courts */ export declare function gatherRegexes(courts: Courts): Promise<CompiledRegexes>; /** * Check if a court is a bankruptcy court */ export declare function isBankruptcyCourt(court: Court): boolean; /** * Check if a court matches the location filter */ export declare function matchesLocation(court: Court, location: string): boolean; /** * Check if a court was active on a given date */ export declare function isCourtActiveOnDate(court: Court, date: Date): boolean;