create-auto-layout-plugin.tsx 420 B

1234567891011121314
  1. import { definePluginCreator } from '@flowgram.ai/core';
  2. import { AutoLayoutOptions } from './type';
  3. import { AutoLayoutService } from './services';
  4. export const createFreeAutoLayoutPlugin = definePluginCreator<AutoLayoutOptions>({
  5. onBind: ({ bind }) => {
  6. bind(AutoLayoutService).toSelf().inSingletonScope();
  7. },
  8. onInit: (ctx, opts) => {
  9. ctx.get(AutoLayoutService).init(opts);
  10. },
  11. singleton: true,
  12. });