Zum Inhalt springen

sdk

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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.

A

The type of the success value produced by the effect.

E

The type of the error value produced by the effect.

Effect<A, E, never>

The Effect instance to be converted.

Promise<any>

The Effect to be converted.

A promise that resolves to the plain JavaScript object representation of the effect’s result.


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.

Use this as the entry point for all SDK operations. Provides access to all core features.

import { Effect } from 'studiocms/effect';
import { SDKCore } from 'studiocms:sdk';
const db = Effect.gen(function* () {
const sdk = yield* SDKCore;
return sdk.db;
});

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.

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.

A promise that resolves to the core properties of SDKCore as a plain JavaScript object.