convert.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 { FunctionProp, NzSafeAny } from 'ng-zorro-antd/core/types';
  6. export declare function toBoolean(value: unknown): boolean;
  7. export declare function numberAttributeWithZeroFallback(value: unknown): number;
  8. export declare function numberAttributeWithOneFallback(value: unknown): number;
  9. export declare function numberAttributeWithInfinityFallback(value: unknown): number;
  10. export declare function toNumber(value: number | string): number;
  11. export declare function toNumber<D>(value: number | string, fallback: D): number | D;
  12. export declare function toCssPixel(value: number | string): string;
  13. /**
  14. * Get the function-property type's value
  15. */
  16. export declare function valueFunctionProp<T>(prop: FunctionProp<T> | T, ...args: NzSafeAny[]): T;
  17. /**
  18. * @deprecated Use input transform instead: `@Input({ transform })`
  19. *
  20. * Input decorator that handle a prop to do get/set automatically with toBoolean
  21. *
  22. * Why not using @InputBoolean alone without @Input? AOT needs @Input to be visible
  23. *
  24. * @howToUse
  25. * ```
  26. * @Input() @InputBoolean() visible: boolean = false;
  27. *
  28. * // Act as below:
  29. * // @Input()
  30. * // get visible() { return this.__visible; }
  31. * // set visible(value) { this.__visible = value; }
  32. * // __visible = false;
  33. * ```
  34. */
  35. export declare function InputBoolean(): NzSafeAny;
  36. /**
  37. * @deprecated Use input transform instead: `@Input({ transform })`
  38. */
  39. export declare function InputCssPixel(): NzSafeAny;
  40. /**
  41. * @deprecated Use input transform instead: `@Input({ transform })`
  42. */
  43. export declare function InputNumber(fallbackValue?: NzSafeAny): NzSafeAny;