Skip to content

Improve TypeScript type definitions#151

Draft
puckey wants to merge 7 commits intoditojs:masterfrom
puckey:chore/improve-ts-types
Draft

Improve TypeScript type definitions#151
puckey wants to merge 7 commits intoditojs:masterfrom
puckey:chore/improve-ts-types

Conversation

@puckey
Copy link
Contributor

@puckey puckey commented Mar 8, 2026

Improve TypeScript type definitions across all three packages, developed step by step together with Claude.

Admin

  • Add JSDoc documentation to API config, schema, and component types
  • Add missing types: SchemaFields, SchemaRoute, SchemaEvents, SchemaOpen, SchemaTextMixin, SchemaAffixMixin, SchemaDataMixin, WatchHandlers, PanelSchema, ClipboardConfig, DitoComponentInstance
  • Add missing properties to existing types (e.g. class, info, maxLength, prefix/suffix, search, editable on options)
  • Fix incorrect types (e.g. SchemaOptions array, parse accessor, resizable as accessor)
  • Replace SchemaSetupMixin/SchemaRouteMixin with SchemaFields/SchemaRoute (keeping deprecated aliases)
  • Add CollectionController base class, RelationController
  • Type view and form schemas (ViewSchema, Form, Tabs)
  • Add DitoContext properties and utility types (Buttons, Resource, Components)

Server

  • Add JSDoc documentation to Model, Controller, Application, and action types
  • Add missing methods and properties to Application (router, assets, validators, storage, services)
  • Add missing methods to Model (lifecycle hooks, $transaction, $emit, $filterGraph, $populateGraph, $formatDatabaseJson, $parseDatabaseJson)
  • Add CollectionController base class with query building and member resolution
  • Add CompiledParametersValidator type
  • Add modify/filter to ModelRelation
  • Fix ModelScope signature, count return type (Promise<number>), ModelControllerHooks key types
  • Add Authorize documentation and UsersController.isAuthenticated

Utils

  • Convert type guards to proper type predicates (isPlainObject, isObject, isInteger, isAsync, etc.)
  • Add missing exports (isArray, isPlainArray, isModule, defaultFormats)
  • Add JSDoc documentation to mergeDeeply, assignDeeply, mapConcurrently, mapSequentially, data path functions, toPromiseCallback
  • Broaden format/formatDate value types, fix parseDataPath return type
  • Remove unused internal utility types

@puckey puckey force-pushed the chore/improve-ts-types branch from 5035107 to 5148a5c Compare March 8, 2026 15:42
puckey added 4 commits March 8, 2026 16:59
- Remove filler words and internal implementation details
- Clarify `nested` with examples and defaults
- Add JSDoc for HiddenSchema, ComputedSchema, DataSchema
- Simplify DitoComponentInstance docs
- Remove redundant type restatements
@puckey puckey marked this pull request as draft March 8, 2026 20:33
@lehni
Copy link
Contributor

lehni commented Mar 9, 2026

@puckey thanks for these! It looks like there's a merge conflicts though? Could you take a look? Otherwise good to go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants