diff --git a/src/internal/field-types.ts b/src/internal/field-types.ts index e45fe3a..4fb2a55 100644 --- a/src/internal/field-types.ts +++ b/src/internal/field-types.ts @@ -63,6 +63,13 @@ export interface StoredRow { [field: string]: StoredValue; } +/** + * The name {@link StoredRow} had before 0.7.0. + * + * @deprecated Use {@link StoredRow}. + */ +export type RowFields = StoredRow; + /** Parse outcome accepting the field value, carrying the value to write. */ export interface FieldParseSuccess { success: true; diff --git a/src/metadata.ts b/src/metadata.ts index a81d642..0f64406 100644 --- a/src/metadata.ts +++ b/src/metadata.ts @@ -59,6 +59,7 @@ export type { FieldValidationResult, FieldValue, FieldValues, + RowFields, StoredRow, ForeignOptions, FieldValidator, diff --git a/src/tests/index/consumer_declarations.test.ts b/src/tests/index/consumer_declarations.test.ts index 367d90a..ea34c28 100644 --- a/src/tests/index/consumer_declarations.test.ts +++ b/src/tests/index/consumer_declarations.test.ts @@ -11,7 +11,7 @@ import { Table } from "@antelopejs/interface-database-decorators"; import { LocalizationModifier } from "@antelopejs/interface-database-decorators/modifiers/localization"; import { DataController, DefaultRoutes, RegisterDataController } from "@antelopejs/interface-data-api"; import { Query, Validation } from "@antelopejs/interface-data-api/components"; -import { Access, AccessMode, ModifierKey, type StoredRow } from "@antelopejs/interface-data-api/metadata"; +import { Access, AccessMode, ModifierKey, type RowFields, type StoredRow } from "@antelopejs/interface-data-api/metadata"; class Article extends Table { declare title: string; @@ -29,6 +29,8 @@ export class ArticleAPI extends DataController(Article, DefaultRoutes.All, Contr export const read: typeof Query.ReadProperties = Query.ReadProperties; export const clear: typeof Validation.ClearInternal = Validation.ClearInternal; export const row: StoredRow = { title: "a" }; +export const legacyRow: RowFields = row; +export const legacyGet: typeof DefaultRoutes.Get extends { func: (...args: never[]) => Promise | RowFields } ? true : false = true; `; /** The diagnostics of a module that imports this package's built declarations, library declarations checked too. */