Skip to content
  • Android
  • iOS
  • Web

Engine Core

Initialize the shared Rust core before using its low-level bindings.

Examples

Quick start

nayan-ui/core
import { prepareCore } from 'nayan-ui/core';

export async function initialize() {
  await prepareCore();
}

Prepare the core before creating a drawing

nayan-ui/core
import { prepareCore } from 'nayan-ui/core';
import { DrawingDocument } from 'nayan-ui/drawing';

export async function openSketch(width: number, height: number) {
  await prepareCore();
  const document = new DrawingDocument(width, height);
  return { document, dispose: () => document.dispose() };
}
Related guide

Tags