base-graph-source.d.ts 906 B

1234567891011121314151617181920212223
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { SelectionModel } from '@angular/cdk/collections';
  6. export interface NzGraphBaseSource<T, K> {
  7. /** The saved graph nodes data for `expandAll` action. */
  8. dataSource: T;
  9. /** The expansion model */
  10. expansionModel: SelectionModel<K>;
  11. /** Whether the data node is expanded or collapsed. Return true if it's expanded. */
  12. isExpanded(dataNode: K): boolean;
  13. /** Expand or collapse data node */
  14. toggle(dataNode: K): void;
  15. /** Expand one data node */
  16. expand(dataNode: K): void;
  17. /** Collapse one data node */
  18. collapse(dataNode: K): void;
  19. /** Expand all the dataNodes in the tree */
  20. expandAll(): void;
  21. /** Collapse all the dataNodes in the tree */
  22. collapseAll(): void;
  23. }