Skip to content

달빛약속 / core/mod / RuntimeConfig

Interface: RuntimeConfig

RuntimeConfig 객체를 사용하여 약속 런타임을 설정합니다.

typescript
import { yaksok, RuntimeConfig } from '@dalbit-yaksok/core'

const runtimeConfig: RuntimeConfig = {
   stdout: console.log,
   stderr: console.error,
   entryPoint: 'main',
   executionDelay: 0,
   runFFI: (runtime, code, args) => {
       throw new Error(`FFI ${runtime} not implemented`)
   },
   flags: {},
   events: {
       runningCode: (start, end) => {
           //  Do something with start and end
       )
   }
}

await yaksok(`"안녕" 보여주기`, runtimeConfig)

Properties

entryPoint

entryPoint: string

여러 약속 파일이 주어졌을 때 처음으로 실행할 파일 이름입니다.

Default

ts
'main'

Defined in

core/runtime/runtime-config.ts:47


events

events: Events

코드 실행 중 발생하는 이벤트를 구독합니다.

Defined in

core/runtime/runtime-config.ts:73


executionDelay

executionDelay: number

각 라인의 실행을 지연시킬 시간 (밀리초). 코드 시각화 목적으로 사용합니다.

Default

ts
0

Defined in

core/runtime/runtime-config.ts:52


flags

flags: Partial<Record<FUTURE_FUNCTION_INVOKE_SYNTAX, boolean>>

활성화할 기능 플래그

Defined in

core/runtime/runtime-config.ts:69


runFFI()

runFFI: (runtime, code, args) => ValueType | Promise<ValueType>

번역 문법을 사용한 외부 런타임 호출을 처리하는 메소드

typescript
function runFFI(runtime: string, code: string, args: FunctionInvokingParams): Promise<ValueType> {

}

Parameters

runtime

string

code

string

args

FunctionInvokingParams

Returns

ValueType | Promise<ValueType>

Defined in

core/runtime/runtime-config.ts:61


stderr()

stderr: (message) => void

오류로 인해 발생한 메시지를 처리하는 메소드

Parameters

message

string

Returns

void

Default

ts
console.error

Defined in

core/runtime/runtime-config.ts:42


stdout()

stdout: (message) => void

보여주기에서 전달된 메시지를 처리하는 메소드

Parameters

message

string

Returns

void

Default

ts
console.log

Defined in

core/runtime/runtime-config.ts:37