Initial typings

This commit is contained in:
Adria Navarro 2025-01-13 11:30:04 +01:00
parent d8abff1a75
commit 20a226a0a5
3 changed files with 8 additions and 4 deletions

View File

@ -1,19 +1,20 @@
import { Constants } from "@budibase/frontend-core"
import { Constants, APIClient } from "@budibase/frontend-core"
import { FieldTypes } from "../constants"
import { Row, Table } from "@budibase/types"
export const patchAPI = API => {
export const patchAPI = (API: APIClient) => {
/**
* Enriches rows which contain certain field types so that they can
* be properly displayed.
* The ability to create these bindings has been removed, but they will still
* exist in client apps to support backwards compatibility.
*/
const enrichRows = async (rows, tableId) => {
const enrichRows = async (rows: Row[], tableId: string) => {
if (!Array.isArray(rows)) {
return []
}
if (rows.length) {
const tables = {}
const tables: Record<string, Table> = {}
for (let row of rows) {
// Fall back to passed in tableId if row doesn't have it specified
let rowTableId = row.tableId || tableId

View File

@ -46,6 +46,8 @@ import { buildLogsEndpoints } from "./logs"
import { buildMigrationEndpoints } from "./migrations"
import { buildRowActionEndpoints } from "./rowActions"
export type { APIClient } from "./types"
/**
* Random identifier to uniquely identify a session in a tab. This is
* used to determine the originator of calls to the API, which is in

View File

@ -1,4 +1,5 @@
export { createAPIClient } from "./api"
export type { APIClient } from "./api"
export { fetchData, DataFetchMap } from "./fetch"
export type { DataFetchType } from "./fetch"
export * as Constants from "./constants"