config.service.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  1. import { Observable } from 'rxjs';
  2. import { NzConfig, NzConfigKey } from './config';
  3. import * as i0 from "@angular/core";
  4. export declare class NzConfigService {
  5. private configUpdated$;
  6. /** Global config holding property. */
  7. private readonly config;
  8. private readonly cspNonce;
  9. constructor();
  10. getConfig(): NzConfig;
  11. getConfigForComponent<T extends NzConfigKey>(componentName: T): NzConfig[T];
  12. getConfigChangeEventForComponent(componentName: NzConfigKey): Observable<void>;
  13. set<T extends NzConfigKey>(componentName: T, value: NzConfig[T]): void;
  14. static ɵfac: i0.ɵɵFactoryDeclaration<NzConfigService, never>;
  15. static ɵprov: i0.ɵɵInjectableDeclaration<NzConfigService>;
  16. }
  17. /**
  18. * This decorator is used to decorate class field. If a class field is decorated and unassigned, it would try to load default value from `NZ_CONFIG`
  19. *
  20. * @note that the class must have `_nzModuleName`({@link NzConfigKey}) property.
  21. * @example
  22. * ```ts
  23. * class ExampleComponent {
  24. * private readonly _nzModuleName: NzConfigKey = 'button';
  25. * @WithConfig() size: string = 'default';
  26. * }
  27. * ```
  28. */
  29. export declare function WithConfig<This, Value>(): (_value: undefined, context: ClassFieldDecoratorContext<This, Value>) => void;