Skip to content

Keyed-реестры (паттерн A)

core.loader

  • Use: useLoaderRegistry()
  • Ключ: loader.id (vanilla, fabric, forge, …)
  • Значение: BaseLoader
ts
useLoaderRegistry().register(myLoader.id, myLoader);

core.modProvider

  • Use: useModProviderRegistry() или registerModMarketplaceProvider(provider)
  • Ключ: id провайдера маркетплейса
  • Значение: ModMarketplaceProvider

core.fileEditor

Редактор файлов в IDE сборки (ключ — id провайдера редактора).

core.accountProvider

  • Use: useAccountProviderRegistry()
  • Ключ: provider.id
  • Значение: IAuthProvider

Расширение может зарегистрировать свой провайдер входа; он появится в диалоге «Добавить аккаунт». OAuth и секреты — на стороне автора расширения.

ts
import { defineRyntExtension, useAccountProviderRegistry } from '@rynt/sdk/extension';

export default defineRyntExtension(() => {
  useAccountProviderRegistry().register('my-oauth', myProvider);
});

core.inviteHandler

  • Use: useInviteHandlerRegistry()
  • Ключ: invite.type
  • Значение: InviteHandlerRegistration
ts
export interface InviteHandlerRegistration {
  subtitle?: (invite: EntityInvite) => string;
  outgoingLabel?: (invite: EntityInvite) => string;
  primaryActionLabel?: (invite: EntityInvite) => string;
  onAccept?: (invite: EntityInvite, ctx: InviteHandlerAcceptContext) => Promise<void>;
}

InviteHandlerAcceptContext: acceptInvite, rejectInvite, loadAllInvites, routerPush.

Встроенные типы: build, map, server, local_build, request_join_local, friend (registerBuiltinInviteHandlers).

Для нового invite.type нужна поддержка API бэкенда или полностью клиентский flow в расширении.

Markdown · Ограничения →