sdk
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Variables
Section titled “Variables”runSDK()
Section titled “runSDK()”const runSDK: <A, E>(effect: Effect<A, E, never>) => Promise<any> = convertToVanilla;
Defined in: studiocms/packages/studiocms/src/sdk/index.ts:50^
Alias for convertToVanilla
, used to run SDK effects and convert them to plain JavaScript objects.
Converts an Effect
into an object containing both synchronous and asynchronous execution methods.
Type Parameters
Section titled “Type Parameters”A
The type of the success value produced by the effect.
E
The type of the error value produced by the effect.
Parameters
Section titled “Parameters”effect
Section titled “effect”Effect
<A
, E
, never
>
The Effect
instance to be converted.
Returns
Section titled “Returns”Promise
<any
>
The Effect to be converted.
Returns
Section titled “Returns”A promise that resolves to the plain JavaScript object representation of the effect’s result.
SDKCore
Section titled “SDKCore”const SDKCore: any;
Defined in: studiocms/packages/studiocms/src/sdk/index.ts:23^
The main Effect-TS based SDK implementation. This unified SDK merges normal and cached SDK functionalities.
Remarks
Section titled “Remarks”Use this as the entry point for all SDK operations. Provides access to all core features.
Example
Section titled “Example”import { Effect } from 'studiocms/effect';import { SDKCore } from 'studiocms:sdk';
const db = Effect.gen(function* () { const sdk = yield* SDKCore; return sdk.db;});
SDKCoreJs
Section titled “SDKCoreJs”const SDKCoreJs: any;
Defined in: studiocms/packages/studiocms/src/sdk/index.ts:37^
Converts the SDKCore
effect to a vanilla JavaScript object by removing the _tag
property.
Remarks
Section titled “Remarks”This function uses Effect.gen
to yield the SDKCore
effect, destructures the result to exclude the _tag
property,
and then passes the remaining core properties to convertToVanilla
.
Returns
Section titled “Returns”A promise that resolves to the core properties of SDKCore
as a plain JavaScript object.