/** 시도별 { code: 시도코드, sgg: { 시군구명: 시군구코드 } } */ declare const REGIONS: Record; }>; /** 학교급 구분 코드 (schulKndCode) */ declare const SCHOOL_KIND: { readonly 초등학교: "02"; readonly 중학교: "03"; readonly 고등학교: "04"; readonly 특수학교: "05"; readonly 그외학교: "06"; readonly 각종학교: "07"; }; type SchoolKindName = keyof typeof SCHOOL_KIND; /** * OpenAPI 조사항목(apiType) 코드 → 항목명 * 학교기본정보(0)는 학교 검색/메타 조회에 사용. * 나머지는 SCHUL_CODE 등으로 상세 공시정보 조회. * * ⚠️ "교과별(학년별) 교수·학습 및 평가 운영 계획"(수행평가 주제/평가기준)은 * OpenAPI 정형 항목에 없음 — hwp 첨부파일로만 공시됨 (evaluation.ts 참조). */ declare const API_TYPES: Record; /** 항목명(부분일치) → apiType 코드 검색 */ declare function findApiType(query: string): { code: string; name: string; }[]; /** 시도명 정규화 — "서울"·"충북"·"강원도" 같은 약칭/구명칭 허용 */ declare function resolveSido(input: string): { name: string; code: string; } | null; /** 시도 내 시군구명 정규화 — "강남"→"강남구", "성남"→"성남시"(시 전체 우선) */ declare function resolveSgg(sidoName: string, input: string): { name: string; code: string; } | null; interface School { schoolCode: string; shlIdfCd: string; name: string; kind: string; foundation: string; office: string; officeCode: string; address: string; tel: string; homepage: string; sidoCode: string; sggCode: string; schulKndCode: string; raw: Record; } interface ApiResult { resultCode: string; resultMsg: string; list: T[]; } declare class SchoolInfoClient { private apiKey; constructor(apiKey: string); /** 임의 조사항목(apiType) 원시 호출 */ request(apiType: string, opts: { sidoCode: string; sggCode: string; schulKndCode: string; pbanYr?: string | number; }): Promise; /** * 학교 검색 — 시도/시군구/학교급으로 지역 내 학교 목록을 받고, * 이름 부분일치로 필터한다. (OpenAPI에 학교명 직접검색 파라미터가 없음) */ searchSchools(params: { sido: string; sgg: string; kind: SchoolKindName; name?: string; }): Promise; /** * 특정 학교의 공시정보(특정 apiType)를 조회한다. * 해당 지역 전체를 받아 SCHUL_CODE로 필터한다. */ /** * 지역(시도/시군구/학교급) 전체 학교의 apiType 행을 반환한다 (캐시). * 학교알리미가 항목 조회 시 시군구 전체를 한 번에 주므로, 학교별 조회와 지역 비교가 이 list를 공유한다. */ getAreaDisclosure(apiType: string, sidoCode: string, sggCode: string, schulKndCode: string, year?: string | number): Promise[]>; getDisclosure(school: School, apiType: string, year?: string | number): Promise<{ name: string; rows: Record[]; }>; } /** 전국 이름검색 결과 (지역/학교급 선택 없이 학교명만으로) */ interface SchoolHit { name: string; shlIdfCd: string; schoolCode: string; sido: string; sgg: string; dong: string; kind: string; foundation: string; address: string; } /** * 학교명만으로 전국 검색 (시도/시군구/학교급 선택 불필요). * 공시포털 자동완성 엔드포인트를 그대로 호출 — 인증키가 필요 없다. * 결과의 sido/sgg/kind로 기존 공시·평가계획 조회에 그대로 브릿지된다. */ declare function searchSchoolsByName(word: string, limit?: number): Promise; declare const DISCLOSURE_PORTAL = "https://www.schoolinfo.go.kr/ei/ss/pneiss_a03_s0.do"; interface EvaluationFile { seq: string; filename: string; sizeKB?: number; } /** 평가계획 첨부파일 목록 + 다운로드 파라미터 조회 (POST b43) */ declare function fetchEvaluationFiles(shlIdfCd: string, schoolName: string, year?: number): Promise<{ files: EvaluationFile[]; downloadParams: Record; }>; /** 특정 첨부파일 다운로드 (GET EiFileDownLoad) */ declare function downloadEvaluationFile(downloadParams: Record, seq: string): Promise<{ buffer: ArrayBuffer; filename: string; }>; interface EvaluationResult { filename: string; fileType: string; markdown: string; evaluationSections: string[]; /** 본문 추출이 빈약(이미지 PDF 추정)해 OCR/수동확인이 필요할 때 true */ needsOcr?: boolean; } /** * 평가계획 첨부파일 목록을 수행평가 관련성 순으로 정렬해 반환한다 (다운로드/파싱 전). * 과목별로 쪼개진 학교(과목별 PDF 여러 개)는 목록을 먼저 보여주고 선택하게 하기 위함. */ declare function listEvaluationDocs(school: School, year?: number): Promise<{ docs: EvaluationFile[]; downloadParams: Record; year: number; }>; /** 특정 첨부파일을 다운로드 + kordoc 파싱 */ declare function fetchEvaluationBySeq(downloadParams: Record, file: EvaluationFile): Promise; /** * 학교의 평가계획을 **자동으로** 다운로드하고 kordoc으로 파싱한다. * - 기본: 우선순위 1순위 파일 1개 * - opts.all: 전체 과목 파일 * - opts.seq: 특정 파일만 (과목 선택) */ declare function autoFetchEvaluation(school: School, year?: number, opts?: { all?: boolean; seq?: string; }): Promise; /** 평가계획 찾는 법 안내 (자동 다운로드 실패 시 폴백) */ declare function evaluationGuide(school: School, year?: number): string; /** 내려받은(혹은 업로드된) 평가계획 문서를 kordoc으로 파싱 */ declare function parseEvaluationDocument(input: ArrayBuffer | Buffer, filePath?: string): Promise<{ fileType: string; markdown: string; evaluationSections: string[]; }>; /** 마크다운에서 수행평가/평가 관련 구간 추출 */ declare function extractEvaluationSections(markdown: string): string[]; interface GradeOverview { grade: number | null; label: string; subjects: string[]; tableHtml: string; details?: Record; } interface StructuredEvaluation { grades: GradeOverview[]; allSubjects: string[]; } /** * 통합형 평가계획 마크다운을 학년별 종합표로 구조화한다. * 학년이 매핑된 종합표가 1개 이상일 때만 결과를 반환(아니면 null → 호출부가 폴백 렌더). */ declare function structureEvaluation(markdown: string): StructuredEvaluation | null; declare function createClient(apiKey?: string): SchoolInfoClient; /** 학교 한 곳을 사람이 읽기 좋은 마크다운으로 */ declare function formatSchool(s: School): string; /** 공시정보 행(들)을 마크다운 표로. apiType을 주면 컬럼명을 한글 라벨로 변환 */ declare function formatDisclosure(name: string, rows: Record[], apiType?: string): string; /** * 학교 한 곳의 "주요 공시" 묶음 조회 — 학부모가 자주 보는 항목. */ declare const PARENT_DIGEST: string[]; interface DigestEntry { name: string; rows: Record[]; apiType: string; /** 조회 실패(인증/네트워크/타임아웃 등)면 true — '데이터 없음'(rows:[])과 구분. check가 거짓 변경알림을 막는 데 사용 */ error?: boolean; } interface AreaSchoolStudents { name: string; schoolCode: string; total: number | null; byGrade: Record; classes: number | null; perClass: number | null; perTeacher: number | null; } interface AreaStudents { sido: string; sgg: string; kind: string; year: number; grades: number[]; schools: AreaSchoolStudents[]; } declare function getAreaStudents(client: SchoolInfoClient, sidoName: string, sggInput: string, kind: SchoolKindName, year?: number): Promise; interface SchoolReportRow { name: string; schoolCode: string; total: number | null; perClass: number | null; mealType: string | null; tempTeacherRate: number | null; clubs: number | null; } interface AreaReport { sido: string; sgg: string; kind: string; year: number; schools: SchoolReportRow[]; } /** 시군구 내 학교들을 핵심 지표로 비교 (전학·입학 판단용) */ declare function getAreaReport(client: SchoolInfoClient, sidoName: string, sggInput: string, kind: SchoolKindName, year?: number): Promise; /** 비교 리포트를 마크다운 표로 (MCP/CLI 공용) */ declare function formatAreaReport(rep: AreaReport, names?: string[]): string; declare function getParentDigest(client: SchoolInfoClient, school: School, year?: number): Promise; export { API_TYPES, type ApiResult, type AreaReport, type AreaSchoolStudents, type AreaStudents, DISCLOSURE_PORTAL, type DigestEntry, type EvaluationFile, type EvaluationResult, type GradeOverview, PARENT_DIGEST, REGIONS, SCHOOL_KIND, type School, type SchoolHit, SchoolInfoClient, type SchoolKindName, type SchoolReportRow, type StructuredEvaluation, autoFetchEvaluation, createClient, downloadEvaluationFile, evaluationGuide, extractEvaluationSections, fetchEvaluationBySeq, fetchEvaluationFiles, findApiType, formatAreaReport, formatDisclosure, formatSchool, getAreaReport, getAreaStudents, getParentDigest, listEvaluationDocs, parseEvaluationDocument, resolveSgg, resolveSido, searchSchoolsByName, structureEvaluation };