virtuals/sdk
此内容尚不支持你的语言。
Variables
Section titled “Variables”runSDK
Section titled “runSDK”const runSDK: any = runEffect;
Defined in: studiocms/packages/studiocms/src/virtuals/sdk/index.ts:49^
Alias for runEffect
, used to run SDK effects and convert them to plain JavaScript objects.
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/virtuals/sdk/index.ts:22^
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/virtuals/sdk/index.ts:36^
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 runEffect
.
Returns
Section titled “Returns”A promise that resolves to the core properties of SDKCore
as a plain JavaScript object.