Skip to content

Commit 1276819

Browse files
committed
more updates
1 parent 322d71d commit 1276819

5 files changed

Lines changed: 44 additions & 21 deletions

File tree

scripts/mintlify-post-processing/typedoc-plugin/typedoc-mintlify-linked-types.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,21 @@ function getTypeString(type) {
320320
return type.types?.map((t) => getTypeString(t)).join(" & ") || "any";
321321
case "literal":
322322
return JSON.stringify(type.value);
323-
case "reflection":
323+
case "reflection": {
324+
// Check if this is a function type (has call signatures)
325+
const decl = type.declaration;
326+
if (decl?.signatures?.length > 0) {
327+
const sig = decl.signatures[0];
328+
const params =
329+
sig.parameters
330+
?.map((p) => `${p.name}: ${getTypeString(p.type)}`)
331+
.join(", ") || "";
332+
const returnType = getTypeString(sig.type) || "void";
333+
return `(${params}) => ${returnType}`;
334+
}
335+
// Otherwise it's an object type
324336
return "object";
337+
}
325338
default:
326339
return type.name || "any";
327340
}

scripts/mintlify-post-processing/typedoc-plugin/typedoc-mintlify-parameters.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,20 @@ function parseParametersWithExpansion(
310310
return { type: simpleMatch[1], link: null };
311311
}
312312

313+
// Handle function type format: (`param`) => `returnType` or (`param`: `Type`) => `returnType`
314+
// e.g., (`conversation`) => `void` or (`error`: `Error`) => `void`
315+
if (trimmed.startsWith("(") && trimmed.includes("=>")) {
316+
const sanitized = trimmed
317+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, "$1") // Remove markdown links
318+
.replace(/`/g, "") // Remove backticks
319+
.replace(/\\/g, "") // Remove escapes
320+
.replace(/\s+/g, " ") // Normalize whitespace
321+
.trim();
322+
if (sanitized) {
323+
return { type: sanitized, link: null };
324+
}
325+
}
326+
313327
// Fallback: sanitize markdown-heavy type definitions such as `Partial`<[`Type`](link)>
314328
if (trimmed.startsWith("`")) {
315329
const sanitized = trimmed
@@ -578,6 +592,20 @@ function parseParameters(
578592
return { type: simpleMatch[1], link: null };
579593
}
580594

595+
// Handle function type format: (`param`) => `returnType` or (`param`: `Type`) => `returnType`
596+
// e.g., (`conversation`) => `void` or (`error`: `Error`) => `void`
597+
if (trimmed.startsWith("(") && trimmed.includes("=>")) {
598+
const sanitized = trimmed
599+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, "$1") // Remove markdown links
600+
.replace(/`/g, "") // Remove backticks
601+
.replace(/\\/g, "") // Remove escapes
602+
.replace(/\s+/g, " ") // Normalize whitespace
603+
.trim();
604+
if (sanitized) {
605+
return { type: sanitized, link: null };
606+
}
607+
}
608+
581609
// Fallback: sanitize markdown-heavy type definitions such as `Partial`<[`Type`](link)>
582610
if (trimmed.startsWith("`")) {
583611
const sanitized = trimmed

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type { Base44Client, CreateClientConfig, CreateClientOptions };
2323
*
2424
* This is the main entry point for the Base44 SDK. It creates a client that provides access to the SDK's modules, such as {@linkcode EntitiesModule | entities}, {@linkcode AuthModule | auth}, and {@linkcode FunctionsModule | functions}.
2525
*
26-
* Typically, you don't need to call this function directly. Base44 creates the client for you, which you can import and use to make API calls. The client takes care of managing authentication for you.
26+
* Typically, you don't need to call this function because Base44 creates the client for you. You can then import and use the client to make API calls. The client takes care of managing authentication for you.
2727
*
2828
* The client supports three authentication modes:
2929
* - **Anonymous**: Access modules anonymously without authentication using `base44.moduleName`. Operations are scoped to public data and permissions.

src/client.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface CreateClientConfig {
3939
*/
4040
appId: string;
4141
/**
42-
* User authentication token. Use this in the frontend when you want to authenticate as a specific user.
42+
* User authentication token. Used to authenticate as a specific user.
4343
*/
4444
token?: string;
4545
/**

src/modules/integrations.types.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ export interface GenerateImageParams {
5555
prompt: string;
5656
}
5757

58-
/**
59-
* Return type for the GenerateImage function.
60-
*/
6158
export interface GenerateImageResult {
6259
/** URL of the generated image. */
6360
url: string;
@@ -71,9 +68,6 @@ export interface UploadFileParams {
7168
file: File;
7269
}
7370

74-
/**
75-
* Return type for the UploadFile function.
76-
*/
7771
export interface UploadFileResult {
7872
/** URL of the uploaded file. */
7973
file_url: string;
@@ -93,9 +87,6 @@ export interface SendEmailParams {
9387
from_name?: string;
9488
}
9589

96-
/**
97-
* Return type for the SendEmail function.
98-
*/
9990
export type SendEmailResult = any;
10091

10192
/**
@@ -108,9 +99,6 @@ export interface ExtractDataFromUploadedFileParams {
10899
json_schema: object;
109100
}
110101

111-
/**
112-
* Return type for the ExtractDataFromUploadedFile function.
113-
*/
114102
export type ExtractDataFromUploadedFileResult = object;
115103

116104
/**
@@ -121,9 +109,6 @@ export interface UploadPrivateFileParams {
121109
file: File;
122110
}
123111

124-
/**
125-
* Return type for the UploadPrivateFile function.
126-
*/
127112
export interface UploadPrivateFileResult {
128113
/** URI of the uploaded private file, used to create a signed URL. */
129114
file_uri: string;
@@ -141,9 +126,6 @@ export interface CreateFileSignedUrlParams {
141126
expires_in?: number;
142127
}
143128

144-
/**
145-
* Return type for the CreateFileSignedUrl function.
146-
*/
147129
export interface CreateFileSignedUrlResult {
148130
/** Temporary signed URL to access the private file. */
149131
signed_url: string;

0 commit comments

Comments
 (0)