crankscript 0.11.13 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/commands/CompileCommand/components/Compile.js +1 -1
- package/src/commands/CompileCommand/components/Compile.js.map +1 -1
- package/src/commands/GenerateTypes/components/GenerateTypes.js +6 -2
- package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -1
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +5 -2
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useFetchHtml.d.ts +1 -1
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js +1 -1
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.d.ts +11 -0
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js +70 -0
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js.map +1 -0
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +11 -4
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +7 -37
- package/src/commands/GenerateTypes/hooks/useGetVersion.js +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.d.ts +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js.map +1 -1
- package/src/commands/GenerateTypes/types.d.ts +12 -0
- package/src/commands/GenerateTypes/types.js +3 -0
- package/src/commands/GenerateTypes/types.js.map +1 -0
- package/src/commands/GenerateTypes/utils/createTypeProvider.d.ts +7 -37
- package/src/commands/GenerateTypes/utils/createTypeProvider.js +51 -27
- package/src/commands/GenerateTypes/utils/createTypeProvider.js.map +1 -1
- package/src/commands/NewCommand/components/New.js +1 -1
- package/src/commands/NewCommand/components/New.js.map +1 -1
- package/src/commands/SimulatorCommand/components/Simulator.js +14 -4
- package/src/commands/SimulatorCommand/components/Simulator.js.map +1 -1
- package/src/commands/TranspileCommand/TranspileCommand.d.ts +1 -0
- package/src/commands/TranspileCommand/TranspileCommand.js +10 -1
- package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -1
- package/src/commands/TranspileCommand/components/Transpile.d.ts +3 -2
- package/src/commands/TranspileCommand/components/Transpile.js +5 -3
- package/src/commands/TranspileCommand/components/Transpile.js.map +1 -1
- package/src/commands/TranspileCommand/fn/transpile.d.ts +5 -1
- package/src/commands/TranspileCommand/fn/transpile.js +5 -4
- package/src/commands/TranspileCommand/fn/transpile.js.map +1 -1
- package/src/commands/TranspileCommand/fn/validateEntryPoint.d.ts +5 -0
- package/src/commands/TranspileCommand/fn/validateEntryPoint.js +22 -0
- package/src/commands/TranspileCommand/fn/validateEntryPoint.js.map +1 -0
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.d.ts +4 -1
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +6 -3
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js.map +1 -1
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.d.ts +11 -0
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js +3 -0
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js.map +1 -0
- package/src/components/CheckList/CheckList.d.ts +4 -5
- package/src/components/CheckList/CheckList.js +6 -1
- package/src/components/CheckList/CheckList.js.map +1 -1
- package/src/components/CheckList/Item.d.ts +1 -1
- package/src/components/CheckList/Item.js +24 -6
- package/src/components/CheckList/Item.js.map +1 -1
- package/src/types.d.ts +20 -18
- package/src/types.js.map +1 -1
@@ -4,4 +4,4 @@ export interface ItemProps<TResult> {
|
|
4
4
|
item: CheckListItem<TResult>;
|
5
5
|
start: boolean;
|
6
6
|
}
|
7
|
-
export declare const Item: <TResult>({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, runner, onFinish, ready, }, start, }: ItemProps<TResult>) => React.JSX.Element;
|
7
|
+
export declare const Item: <TResult>({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, skipDescription, runner, onFinish, ready, quitOnError, skip, }, start, }: ItemProps<TResult>) => React.JSX.Element;
|
@@ -2,22 +2,26 @@ import { StatusMessage } from '@inkjs/ui';
|
|
2
2
|
import { Text } from 'ink';
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
4
4
|
import { Spinner } from '../../components/Spinner.js';
|
5
|
-
export const Item = ({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, runner, onFinish, ready }, start })=>{
|
5
|
+
export const Item = ({ item: { runningDescription, waitingDescription, errorDescription, finishedDescription, skipDescription, runner, onFinish, ready, quitOnError = true, skip }, start })=>{
|
6
6
|
const executed = useRef(false);
|
7
7
|
const interval = useRef(null);
|
8
8
|
const [dotCount, setDotCount] = useState(0);
|
9
9
|
const [result, setResult] = useState(null);
|
10
10
|
const [failedReason, setfailedReason] = useState(null);
|
11
|
+
const [isSkipped, setIsSkipped] = useState(false);
|
12
|
+
// Determine if the task should be skipped
|
13
|
+
const shouldSkip = typeof skip === 'function' ? skip() : skip === true;
|
11
14
|
const hasResult = !failedReason && result !== null;
|
12
|
-
const isRunning = !failedReason && !hasResult && start && ready !== false;
|
15
|
+
const isRunning = !failedReason && !hasResult && start && ready !== false && !shouldSkip;
|
13
16
|
const isWaiting = !failedReason && !hasResult && (!start || !ready);
|
14
17
|
const couldStartButNotReady = !failedReason && !hasResult && start && ready === false;
|
15
18
|
useEffect(()=>{
|
16
|
-
if (failedReason) {
|
19
|
+
if (failedReason && quitOnError) {
|
17
20
|
process.exit();
|
18
21
|
}
|
19
22
|
}, [
|
20
|
-
failedReason
|
23
|
+
failedReason,
|
24
|
+
quitOnError
|
21
25
|
]);
|
22
26
|
useEffect(()=>{
|
23
27
|
if (couldStartButNotReady) {
|
@@ -41,6 +45,14 @@ export const Item = ({ item: { runningDescription, waitingDescription, errorDesc
|
|
41
45
|
if (!start || executed.current || ready === false) {
|
42
46
|
return;
|
43
47
|
}
|
48
|
+
// If the task should be skipped, mark it as executed with a success result
|
49
|
+
if (shouldSkip) {
|
50
|
+
executed.current = true;
|
51
|
+
setIsSkipped(true);
|
52
|
+
setResult(true);
|
53
|
+
onFinish == null ? void 0 : onFinish(true);
|
54
|
+
return;
|
55
|
+
}
|
44
56
|
runner().then((result)=>{
|
45
57
|
executed.current = true;
|
46
58
|
if (result === false) {
|
@@ -51,18 +63,24 @@ export const Item = ({ item: { runningDescription, waitingDescription, errorDesc
|
|
51
63
|
onFinish == null ? void 0 : onFinish(result);
|
52
64
|
}).catch((reason)=>{
|
53
65
|
setfailedReason(reason.message);
|
66
|
+
setResult(false);
|
67
|
+
onFinish == null ? void 0 : onFinish(false);
|
54
68
|
});
|
55
69
|
}, [
|
56
70
|
errorDescription,
|
57
71
|
onFinish,
|
58
72
|
runner,
|
59
|
-
start
|
73
|
+
start,
|
74
|
+
shouldSkip
|
60
75
|
]);
|
61
76
|
let message = waitingDescription;
|
62
77
|
let variant = 'info';
|
63
78
|
if (failedReason) {
|
64
79
|
message = ` ${failedReason}`;
|
65
80
|
variant = 'error';
|
81
|
+
} else if (isSkipped) {
|
82
|
+
message = skipDescription || 'Task skipped';
|
83
|
+
variant = 'info';
|
66
84
|
} else if (isRunning) {
|
67
85
|
message = runningDescription;
|
68
86
|
variant = 'warning';
|
@@ -79,7 +97,7 @@ export const Item = ({ item: { runningDescription, waitingDescription, errorDesc
|
|
79
97
|
variant: variant
|
80
98
|
}, /*#__PURE__*/ React.createElement(Text, {
|
81
99
|
bold: !isWaiting,
|
82
|
-
color: isRunning ? 'yellow' : isWaiting ? 'gray' : failedReason ? 'red' : 'green'
|
100
|
+
color: isRunning ? 'yellow' : isWaiting ? 'gray' : failedReason ? 'red' : isSkipped ? 'gray' : 'green'
|
83
101
|
}, message, ' ', couldStartButNotReady && `— not ready yet${'.'.repeat(dotCount)}`));
|
84
102
|
};
|
85
103
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/components/CheckList/Item.tsx"],"sourcesContent":["import { StatusMessage, StatusMessageProps } from '@inkjs/ui';\nimport { Text } from 'ink';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { Spinner } from '@/cli/components/Spinner.js';\nimport { CheckListItem } from '@/cli/types.js';\n\nexport interface ItemProps<TResult> {\n item: CheckListItem<TResult>;\n start: boolean;\n}\n\nexport const Item = <TResult,>({\n item: {\n runningDescription,\n waitingDescription,\n errorDescription,\n finishedDescription,\n runner,\n onFinish,\n ready,\n },\n start,\n}: ItemProps<TResult>) => {\n const executed = useRef(false);\n const interval = useRef<NodeJS.Timeout | null>(null);\n const [dotCount, setDotCount] = useState(0);\n const [result, setResult] = useState<TResult | null>(null);\n const [failedReason, setfailedReason] = useState<string | null>(null);\n const hasResult = !failedReason && result !== null;\n const isRunning
|
1
|
+
{"version":3,"sources":["../../../../../../libs/cli/src/components/CheckList/Item.tsx"],"sourcesContent":["import { StatusMessage, StatusMessageProps } from '@inkjs/ui';\nimport { Text } from 'ink';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { Spinner } from '@/cli/components/Spinner.js';\nimport { CheckListItem } from '@/cli/types.js';\n\nexport interface ItemProps<TResult> {\n item: CheckListItem<TResult>;\n start: boolean;\n}\n\nexport const Item = <TResult,>({\n item: {\n runningDescription,\n waitingDescription,\n errorDescription,\n finishedDescription,\n skipDescription,\n runner,\n onFinish,\n ready,\n quitOnError = true,\n skip,\n },\n start,\n}: ItemProps<TResult>) => {\n const executed = useRef(false);\n const interval = useRef<NodeJS.Timeout | null>(null);\n const [dotCount, setDotCount] = useState(0);\n const [result, setResult] = useState<TResult | null | false>(null);\n const [failedReason, setfailedReason] = useState<string | null>(null);\n const [isSkipped, setIsSkipped] = useState(false);\n\n // Determine if the task should be skipped\n const shouldSkip = typeof skip === 'function' ? skip() : skip === true;\n\n const hasResult = !failedReason && result !== null;\n const isRunning =\n !failedReason && !hasResult && start && ready !== false && !shouldSkip;\n const isWaiting = !failedReason && !hasResult && (!start || !ready);\n const couldStartButNotReady =\n !failedReason && !hasResult && start && ready === false;\n\n useEffect(() => {\n if (failedReason && quitOnError) {\n process.exit();\n }\n }, [failedReason, quitOnError]);\n\n useEffect(() => {\n if (couldStartButNotReady) {\n interval.current = setInterval(() => {\n setDotCount(count => (count + 1) % 4);\n }, 250);\n } else {\n if (interval.current) {\n clearInterval(interval.current);\n }\n }\n\n return () => {\n if (interval.current) {\n clearInterval(interval.current);\n }\n };\n }, [couldStartButNotReady]);\n\n useEffect(() => {\n if (!start || executed.current || ready === false) {\n return;\n }\n\n // If the task should be skipped, mark it as executed with a success result\n if (shouldSkip) {\n executed.current = true;\n setIsSkipped(true);\n setResult(true as TResult);\n onFinish?.(true as TResult);\n return;\n }\n\n runner()\n .then(result => {\n executed.current = true;\n\n if (result === false) {\n setfailedReason(errorDescription);\n\n return;\n }\n\n setResult(result);\n onFinish?.(result);\n })\n .catch(reason => {\n setfailedReason(reason.message);\n setResult(false);\n onFinish?.(false);\n });\n }, [errorDescription, onFinish, runner, start, shouldSkip]);\n\n let message = waitingDescription;\n let variant: StatusMessageProps['variant'] = 'info';\n\n if (failedReason) {\n message = ` ${failedReason}`;\n variant = 'error';\n } else if (isSkipped) {\n message = skipDescription || 'Task skipped';\n variant = 'info';\n } else if (isRunning) {\n message = runningDescription;\n variant = 'warning';\n } else if (hasResult) {\n message = finishedDescription(result);\n variant = 'success';\n }\n\n if (isRunning) {\n return <Spinner label={message} />;\n }\n\n return (\n <StatusMessage variant={variant}>\n <Text\n bold={!isWaiting}\n color={\n isRunning\n ? 'yellow'\n : isWaiting\n ? 'gray'\n : failedReason\n ? 'red'\n : isSkipped\n ? 'gray'\n : 'green'\n }\n >\n {message}{' '}\n {couldStartButNotReady &&\n `— not ready yet${'.'.repeat(dotCount)}`}\n </Text>\n </StatusMessage>\n );\n};\n"],"names":["StatusMessage","Text","React","useEffect","useRef","useState","Spinner","Item","item","runningDescription","waitingDescription","errorDescription","finishedDescription","skipDescription","runner","onFinish","ready","quitOnError","skip","start","executed","interval","dotCount","setDotCount","result","setResult","failedReason","setfailedReason","isSkipped","setIsSkipped","shouldSkip","hasResult","isRunning","isWaiting","couldStartButNotReady","process","exit","current","setInterval","count","clearInterval","then","catch","reason","message","variant","label","bold","color","repeat"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
package/src/types.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ClassDeclarationStructure, FunctionDeclarationStructure, MethodDeclarationStructure, ParameterDeclarationStructure } from 'ts-morph';
|
1
|
+
import { ClassDeclarationStructure, FunctionDeclarationStructure, MethodDeclarationStructure, ParameterDeclarationStructure, PropertyDeclarationStructure, VariableDeclarationStructure } from 'ts-morph';
|
2
2
|
import { Environment } from './environment/dto/Environment.js';
|
3
3
|
import { PlaydateSdkPath } from './environment/path/dto/PlaydateSdkPath.js';
|
4
4
|
export declare enum PlaydateSdkVersionIdentifier {
|
@@ -31,10 +31,13 @@ export type CheckListItem<TResult> = {
|
|
31
31
|
runningDescription: string;
|
32
32
|
waitingDescription: string;
|
33
33
|
errorDescription: string;
|
34
|
-
finishedDescription: (result: TResult) => string;
|
34
|
+
finishedDescription: (result: TResult | false) => string;
|
35
|
+
skipDescription?: string;
|
35
36
|
runner: () => Promise<TResult> | Promise<false>;
|
36
|
-
onFinish?: (result: TResult) => void;
|
37
|
+
onFinish?: (result: TResult | false) => void;
|
37
38
|
ready?: boolean;
|
39
|
+
quitOnError?: boolean;
|
40
|
+
skip?: boolean | (() => boolean);
|
38
41
|
};
|
39
42
|
export interface ParameterDescription {
|
40
43
|
name: string;
|
@@ -63,27 +66,17 @@ export interface ApiObject {
|
|
63
66
|
export interface ApiDefinitions {
|
64
67
|
global: ApiObject;
|
65
68
|
}
|
66
|
-
export interface
|
67
|
-
name: string;
|
68
|
-
type: string;
|
69
|
-
overrideOptions?: Partial<Omit<ParameterDeclarationStructure, 'kind' | 'name' | 'type'>>;
|
70
|
-
}
|
71
|
-
export interface PropertyDetails {
|
69
|
+
export interface PropertyDetails extends Partial<PropertyDeclarationStructure> {
|
72
70
|
signature: string;
|
73
|
-
type: string;
|
74
|
-
isStatic?: boolean;
|
75
|
-
isReadOnly?: boolean;
|
76
71
|
}
|
77
|
-
export
|
72
|
+
export type FunctionDetails = {
|
78
73
|
signature: string;
|
79
74
|
parameters: ParameterDetails[];
|
80
|
-
returnType: string;
|
81
75
|
overrideParameters?: boolean;
|
82
|
-
|
83
|
-
|
84
|
-
export interface ConstantDefinition {
|
76
|
+
} & (Partial<FunctionDeclarationStructure> | Partial<MethodDeclarationStructure>);
|
77
|
+
export type ParameterDetails = ParameterDeclarationStructure;
|
78
|
+
export interface ConstantDefinition extends Partial<VariableDeclarationStructure> {
|
85
79
|
name: string;
|
86
|
-
type: string;
|
87
80
|
}
|
88
81
|
export type TypeProviderData = {
|
89
82
|
globalStatements: string[];
|
@@ -91,6 +84,15 @@ export type TypeProviderData = {
|
|
91
84
|
constants: Record<string, (ConstantDefinition | string)[]>;
|
92
85
|
classes: Record<string, Partial<ClassDeclarationStructure>>;
|
93
86
|
properties: Record<string, PropertyDetails>;
|
87
|
+
/**
|
88
|
+
* Properties that are described in prose rather than in formal API documentation.
|
89
|
+
* While 'properties' contains actual property definitions with their full path as the key,
|
90
|
+
* 'dynamicProperties' contains additional properties that belong to a parent namespace.
|
91
|
+
*
|
92
|
+
* For example, if the docs mention "You can access rect.x, rect.y" in prose,
|
93
|
+
* the key would be "playdate.geometry.rect" and the value would be the properties
|
94
|
+
* that should be added to that namespace.
|
95
|
+
*/
|
94
96
|
dynamicProperties: Record<string, Pick<PropertyDescription, 'name' | 'docs'>[]>;
|
95
97
|
functions: Record<string, FunctionDetails>;
|
96
98
|
};
|
package/src/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../libs/cli/src/types.ts"],"sourcesContent":["import {\n ClassDeclarationStructure,\n FunctionDeclarationStructure,\n MethodDeclarationStructure,\n ParameterDeclarationStructure,\n} from 'ts-morph';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { PlaydateSdkPath } from '@/cli/environment/path/dto/PlaydateSdkPath.js';\n\nexport enum PlaydateSdkVersionIdentifier {\n Latest = 'latest',\n}\n\nexport type PlaydateSdkVersion = PlaydateSdkVersionIdentifier.Latest | string;\n\nexport type EnvironmentHealthResult =\n | {\n isHealthy: true;\n environment: Environment;\n health: EnvironmentHealth;\n }\n | {\n isHealthy: false;\n health: EnvironmentHealth;\n };\n\nexport enum HealthCheckStatusType {\n Healthy = 'Healthy',\n Unhealthy = 'Unhealthy',\n Unknown = 'Unknown',\n}\n\nexport type HealthCheckStatus<TArgument> =\n | {\n healthStatus:\n | HealthCheckStatusType.Unknown\n | HealthCheckStatusType.Unhealthy;\n }\n | {\n healthStatus: HealthCheckStatusType.Healthy;\n argument: TArgument;\n };\n\nexport interface EnvironmentHealth {\n sdkPathKnown: HealthCheckStatus<PlaydateSdkPath>;\n}\n\nexport type CheckListItem<TResult> = {\n runningDescription: string;\n waitingDescription: string;\n errorDescription: string;\n finishedDescription: (result: TResult) => string;\n runner: () => Promise<TResult> | Promise<false>;\n onFinish?: (result: TResult) => void;\n ready?: boolean;\n};\n\nexport interface ParameterDescription {\n name: string;\n required: boolean;\n}\n\nexport interface PropertyDescription {\n signature: string;\n name: string;\n namespaces: string[];\n docs: string;\n}\n\nexport interface FunctionDescription {\n signature: string;\n name: string;\n namespaces: string[];\n parameters: ParameterDescription[];\n hasSelf: boolean;\n docs: string;\n}\n\nexport interface ApiObject {\n functions: FunctionDescription[];\n methods: FunctionDescription[];\n properties: PropertyDescription[];\n namespaces: Record<string, ApiObject>;\n}\n\nexport interface ApiDefinitions {\n global: ApiObject;\n}\n\nexport interface
|
1
|
+
{"version":3,"sources":["../../../../libs/cli/src/types.ts"],"sourcesContent":["import {\n ClassDeclarationStructure,\n FunctionDeclarationStructure,\n MethodDeclarationStructure,\n ParameterDeclarationStructure,\n PropertyDeclarationStructure,\n VariableDeclarationStructure,\n} from 'ts-morph';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { PlaydateSdkPath } from '@/cli/environment/path/dto/PlaydateSdkPath.js';\n\nexport enum PlaydateSdkVersionIdentifier {\n Latest = 'latest',\n}\n\nexport type PlaydateSdkVersion = PlaydateSdkVersionIdentifier.Latest | string;\n\nexport type EnvironmentHealthResult =\n | {\n isHealthy: true;\n environment: Environment;\n health: EnvironmentHealth;\n }\n | {\n isHealthy: false;\n health: EnvironmentHealth;\n };\n\nexport enum HealthCheckStatusType {\n Healthy = 'Healthy',\n Unhealthy = 'Unhealthy',\n Unknown = 'Unknown',\n}\n\nexport type HealthCheckStatus<TArgument> =\n | {\n healthStatus:\n | HealthCheckStatusType.Unknown\n | HealthCheckStatusType.Unhealthy;\n }\n | {\n healthStatus: HealthCheckStatusType.Healthy;\n argument: TArgument;\n };\n\nexport interface EnvironmentHealth {\n sdkPathKnown: HealthCheckStatus<PlaydateSdkPath>;\n}\n\nexport type CheckListItem<TResult> = {\n runningDescription: string;\n waitingDescription: string;\n errorDescription: string;\n finishedDescription: (result: TResult | false) => string;\n skipDescription?: string;\n runner: () => Promise<TResult> | Promise<false>;\n onFinish?: (result: TResult | false) => void;\n ready?: boolean;\n quitOnError?: boolean;\n skip?: boolean | (() => boolean);\n};\n\nexport interface ParameterDescription {\n name: string;\n required: boolean;\n}\n\nexport interface PropertyDescription {\n signature: string;\n name: string;\n namespaces: string[];\n docs: string;\n}\n\nexport interface FunctionDescription {\n signature: string;\n name: string;\n namespaces: string[];\n parameters: ParameterDescription[];\n hasSelf: boolean;\n docs: string;\n}\n\nexport interface ApiObject {\n functions: FunctionDescription[];\n methods: FunctionDescription[];\n properties: PropertyDescription[];\n namespaces: Record<string, ApiObject>;\n}\n\nexport interface ApiDefinitions {\n global: ApiObject;\n}\n\nexport interface PropertyDetails extends Partial<PropertyDeclarationStructure> {\n signature: string;\n}\n\nexport type FunctionDetails = {\n signature: string;\n parameters: ParameterDetails[];\n overrideParameters?: boolean;\n} & (\n | Partial<FunctionDeclarationStructure>\n | Partial<MethodDeclarationStructure>\n);\n\nexport type ParameterDetails = ParameterDeclarationStructure;\n\nexport interface ConstantDefinition\n extends Partial<VariableDeclarationStructure> {\n name: string;\n}\n\nexport type TypeProviderData = {\n globalStatements: string[];\n statements: string[];\n constants: Record<string, (ConstantDefinition | string)[]>;\n classes: Record<string, Partial<ClassDeclarationStructure>>;\n properties: Record<string, PropertyDetails>;\n /**\n * Properties that are described in prose rather than in formal API documentation.\n * While 'properties' contains actual property definitions with their full path as the key,\n * 'dynamicProperties' contains additional properties that belong to a parent namespace.\n *\n * For example, if the docs mention \"You can access rect.x, rect.y\" in prose,\n * the key would be \"playdate.geometry.rect\" and the value would be the properties\n * that should be added to that namespace.\n */\n dynamicProperties: Record<\n string,\n Pick<PropertyDescription, 'name' | 'docs'>[]\n >;\n functions: Record<string, FunctionDetails>;\n};\n\nexport type FunctionTypeOverrideMap = Record<string, { isMethod: boolean }>;\n\nexport enum TemplateName {\n Blank = 'blank',\n}\n"],"names":["PlaydateSdkVersionIdentifier","HealthCheckStatusType","TemplateName"],"rangeMappings":";;;;;;;;;;;;;","mappings":";UAWYA;;GAAAA,iCAAAA;;UAiBAC;;;;GAAAA,0BAAAA;;UA8GAC;;GAAAA,iBAAAA"}
|