# ts-fsrs > Developer documentation for ts-fsrs ## 指南 - [介紹](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/index.md): 說明 ts-fsrs 的用途,以及模型、時間系統與選用 middleware 如何組合成可重複使用且具備型別安全的排程器定義 - [快速開始](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/quick-start.md): 安裝 ts-fsrs,先以 DefaultScheduler 快速接入,再於瀏覽器執行預設與自訂排程器範例並以 Rating.Good 完成複習 - [遷移至 v6 與 FSRS-7](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/migration.md): 將 ts-fsrs v5 遷移至 v6 的 defineScheduler,再透過複習歷史重建 FSRS-7 記憶狀態,不改變既有卡片的下次複習時間,並避免使用 legacy API。 - [架構](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/architecture.md): 理解 ts-fsrs 中 model、chrono、middleware 與 scheduler 的職責,組合可重複使用的預設,並追蹤一次 review 如何產生新的 card 與 revlog - [狀態轉換](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/state-transitions.md): 瞭解評分如何讓卡片在 New、Learning、Review 與 Relearning 之間轉換,以及 card、revlog、記憶狀態與佇列狀態的差異 - [LLM](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/llms.md): 透過 llms.txt、llms-full.txt 與逐頁 Markdown 閱讀目前 ts-fsrs 文件,並使用共用的英文 Atom 訂閱源追蹤更新 - [模型概覽](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/index.md): 說明 FSRS 模型契約、直接使用各版本模型,以及透過 defineModel 定義自訂模型的方法和職責邊界 - [FSRS-7](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/fsrs-7.md): FSRS-7 雙分量遺忘曲線、混合權重、穩定性與難度更新、數值求間隔及參數和記憶狀態遷移限制的實作說明 - [FSRS-6](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/fsrs-6.md): FSRS-6 的可訓練衰減、間隔計算、初始記憶、難度、穩定性和同日更新公式,以及與上一版本的核心差異 - [FSRS-5](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/fsrs-5.md): FSRS-5 的冪函數遺忘曲線、間隔計算、難度、穩定性和同日更新公式,以及與相鄰版本的核心差異和實作說明 - [FSRS-4.5](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/fsrs-4dot5.md): FSRS-4.5 的冪函數遺忘曲線、間隔計算、初始記憶、難度和穩定性更新公式,以及與相鄰版本的核心差異 - [FSRS-4](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/fsrs-4.md): FSRS-4 的冪函數遺忘曲線、間隔計算、初始記憶、難度和穩定性更新公式,以及與相鄰版本的核心差異和實作說明 - [FSRS-3](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/model/fsrs-3.md): FSRS-3 的指數遺忘曲線、間隔計算、初始記憶、難度和穩定性更新公式,以及與後續版本的核心差異和實作說明 - [Chrono 概覽](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/chrono/index.md): 選擇 ts-fsrs 的時間表示,理解 normalize 與天數運算,並透過 defineChrono 自訂 dateChrono - [Date](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/chrono/date.md): 使用 dateChrono 計算 UTC 日期差與固定時長,理解 card 和 revlog 的時間欄位 - [Numeric](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/chrono/numeric.md): 使用 numericChrono 表示相對天數,理解以零為起點的 normalize 及其適用範圍 - [Temporal Instant](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/chrono/temporal-instant.md): 設定 temporalInstantChrono 的時區與小數天數,理解日曆運算與日光節約時間行為 - [中介軟體概覽](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/middleware/index.md): 理解中介軟體如何為排程器加入排程策略與應用程式欄位,並了解如何使用 defineMiddleware 定義欄位與處理函式 - [生命週期](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/middleware/lifecycle.md): 了解中介軟體處理函式如何依註冊順序環繞排程器核心執行,以及復原與預覽如何重用這些處理函式 - [內建策略](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/middleware/built-in.md): 了解 ts-fsrs 隨附的中介軟體策略,以及 DefaultScheduler 如何依序組合它們 - [排程器概覽](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/scheduler/index.md): 用 defineScheduler 把模型與 chrono 組合成可重用的排程器定義,用 .create 為每個設定建立獨立排程器,並與 DefaultScheduler 預設對照 - [DefaultScheduler](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/scheduler/default-scheduler.md): 設定 DefaultScheduler 預設、選擇 FSRS 模型版本,並判斷何時用預設、何時用自訂 defineScheduler 定義 - [訓練器概覽](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/optimizer/index.md): 用 binding 從複習記錄重新訓練 FSRS 權重,選擇 Node 或瀏覽器 / Worker 執行環境,並走通從 CSV 到參數的流程 - [訓練與評估](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/guide/optimizer/train-evaluate.md): 沿 binding 走通複習記錄流程——把 CSV 轉成項、訓練權重、評估擬合,並調整步驟 ## API - [ts-fsrs API 概覽](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/index.md): 受支援的 ts-fsrs API 索引——面向應用程式碼的定義、預設、策略、模型與型別 - [DefaultScheduler](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/default-scheduler.md): DefaultScheduler 的參考——回傳現成排程器預設的非同步工廠 - [Scheduler](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/scheduler.md): defineScheduler.create 與 DefaultScheduler 回傳之排程器實例的參考 - [定義](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/define/index.md): define* 定義函式——宣告排程器、模型、時間抽象與中介軟體 - [defineScheduler](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/define/define-scheduler.md): defineScheduler 的參考——從模型與 chrono 組成可重用的排程器定義 - [defineModel](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/define/define-model.md): defineModel 的參考——把模型定義連同其 schema 與模型核心包裝起來 - [defineChrono](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/define/define-chrono.md): defineChrono 的參考——為排程器定義自訂時間抽象 - [defineMiddleware](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/define/define-middleware.md): defineMiddleware 的參考——擴充 schema 並環繞排程器核心執行處理函式 - [Chrono 預設](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/chrono-presets.md): dateChrono、numericChrono 與 temporalInstantChrono 的參考 - [Rating、Grade、State](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/rating-grade-state.md): 複習與卡片使用的評分與狀態列舉及其驗證 schema - [模型](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/index.md): ts-fsrs/models/fsrs-3 到 fsrs-7 各版本進入點的參考 - [FSRS-7](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/fsrs-7.md): ts-fsrs/models/fsrs-7 參考——模型方法、權重、參數輔助函式、Schema 與型別 - [FSRS-6](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/fsrs-6.md): ts-fsrs/models/fsrs-6 的參考——權重、邊界與參數輔助函式 - [FSRS-5](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/fsrs-5.md): ts-fsrs/models/fsrs-5 的參考——權重、邊界與參數輔助函式 - [FSRS-4.5](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/fsrs-4dot5.md): ts-fsrs/models/fsrs-4dot5 的參考——權重、邊界與參數輔助函式 - [FSRS-4](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/fsrs-4.md): ts-fsrs/models/fsrs-4 的參考——權重、邊界與參數輔助函式 - [FSRS-3](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/models/fsrs-3.md): ts-fsrs/models/fsrs-3 的參考——權重、邊界與參數輔助函式 - [中介軟體](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/index.md): ts-fsrs/middlewares 索引——內建策略,以及與之一同匯出的預設值、輔助函式與 schema - [DesiredRetention](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/desired-retention.md): 內建中介軟體 schedulerDesiredRetentionMiddleware——在間隔計算前套用目標保留率 - [Cost ADR](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/cost-adr.md): Cost ADR 依記憶狀態與複習成本調整保留率。組合時以 `schedulerCostAdrMiddleware` 取代 `schedulerDesiredRetentionMiddleware`;它不包含在 `DefaultScheduler` 中。間隔上限仍由 `schedulerMaximumIntervalMiddleware` 負責。 - [LearningSteps](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/learning-steps.md): 內建中介軟體 schedulerLearningStepsMiddleware——在短期排程中套用學習與再學習步驟 - [Fuzzing](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/fuzz.md): 內建中介軟體 schedulerFuzzingMiddleware——啟用 enableFuzz 時分散間隔 - [MaximumInterval](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/maximum-interval.md): 內建中介軟體 schedulerMaximumIntervalMiddleware——將天級間隔上限設為 maximumInterval - [Stats](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/stats.md): 內建中介軟體 schedulerStatsMiddleware——維護 reps 與 lapses 計數器 - [MonotonicInterval](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/monotonic-interval.md): 內建中介軟體 schedulerMonotonicIntervalMiddleware——跨評分排序間隔 - [ScheduledDays](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/scheduled-days.md): 內建中介軟體 schedulerScheduledDaysMiddleware——將最終間隔儲存為排程天數 - [Leech](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/middlewares/leech.md): 內建中介軟體 schedulerLeechMiddleware——卡片遺忘次數超過閾值時將其暫停 - [Reschedule](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/reschedule.md): ts-fsrs/reschedule 進入點——在一般複習流程之外重播複習歷史並重新排程卡片 - [Utils](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/utils.md): ts-fsrs 根匯出之小型數值輔助函式(clamp 與 roundTo)的參考 - [型別](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/api/ts-fsrs/types.md): ts-fsrs 根匯出型別的參考 ## Playground - [Playground](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/playground.md): 直接在瀏覽器中編輯並執行 ts-fsrs 與 WASIP1 最佳化器範例,使用真實型別宣告、Worker 輸出與複習日誌訓練 ## Others - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/index.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/page/2.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/page/3.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/page/4.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/page/5.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/page/6.md): Published package releases, changelogs, and npm downloads. - [Updates](https://open-spaced-repetition.github.io/ts-fsrs/zh-TW/updates/binding/index.md): Published package releases, changelogs, and npm downloads.