import { Injectable } from '@angular/core';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class SearchDrawerService {
  closeEvent = new Subject<any>();
  createEvent = new Subject<any>();
  initEvent = new Subject<any>();

  visible = false;
  constructor() {}

  create(defaultValue: Record<string, any>, newSchema?: SFSchema, newUI?: SFUISchema) {
    this.createEvent.next({ defaultValue, newSchema, newUI });
    return this;
  }
}
