import { AbstractControl, FormGroupDirective, NgForm } from '@angular/forms'; import * as i0 from '@angular/core'; import { Renderer2, ElementRef } from '@angular/core'; import { ScrollStrategy, OverlayRef } from '@angular/cdk/overlay'; import { Observable } from 'rxjs'; /** * Provider that defines when form controls have an error. */ declare class ErrorStateMatcher { isErrorState(control: AbstractControl | null, form: FormGroupDirective | NgForm | null): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Helper ScrollStrategy to be used in tests to test overriding the default scroll strategy. * * Example usage: * TestBed.resetTestingModule() * .configureTestingModule({ * imports: [ScrollStrategyOverrideComponent, NxAutocompleteModule, NxInputModule, NoopAnimationsModule], * providers: [ * { * provide: NX_AUTOCOMPLETE_SCROLL_STRATEGY, * useFactory: () => fakeScrollStrategyFunction, * }, * ], * }) * .compileComponents(); * createTestComponent(ScrollStrategyOverrideComponent); * expect((testInstance as ScrollStrategyOverrideComponent).scrollStrategy).toBe(fakeScrollStrategyFunction); * */ declare class FakeScrollStrategy implements ScrollStrategy { isEnabled: boolean; overlayRef: OverlayRef; attach(overlayRef: OverlayRef): void; enable(): void; disable(): void; detach(): void; } /** See usage at FakeScrollStrategy */ declare const fakeScrollStrategyFunction: () => FakeScrollStrategy; /** * Assert that a value is not `null` and redefine its type. */ declare function notNull(value: T | null): value is T; /** * Assert that a value is not `undefined` or `null` and redefine its type. */ declare function notNullable(value: T | null | undefined): value is T; /** * Assert that a value is not `undefined` and redefine its type. */ declare function notUndefined(value: T | undefined): value is T; /** * Assert that a value is truthy using the double negation operator `!!` and redefine its type. */ declare function isTruthy(value: T | null | undefined): value is T; /** * Assert that a value is `string` using `typeof` check and redefine its type. */ declare function isString(value: unknown): value is string; /** * Assert that a value is `number` using `typeof` check and redefine its type. */ declare function isNumber(value: unknown): value is number; /** * Assert that a value is `boolean` using `typeof` check and redefine its type. */ declare function isBoolean(value: unknown): value is boolean; /** * Assert that a value is `true` and redefine its type. */ declare function isTrue(value: unknown): value is true; /** * Assert that a value is `false` and redefine its type. */ declare function isFalse(value: unknown): value is false; /** * Assert that a value is `null` and redefine its type. */ declare function isNull(value: unknown): value is null; /** * Assert that a value is `null` or `undefined` and redefine its type. */ declare function isNullable(value: unknown): value is null | undefined; /** * Assert that a value is `undefined` and redefine its type. */ declare function isUndefined(value: unknown): value is undefined; /** * Assert that a value is not `undefined` or `null` or an empty `ArrayLike` object such as `string` and redefine its type. */ declare function notEmpty>(value: T | null | undefined): value is T; declare function pad(str: string, length?: number, padCharacter?: string): string; declare function formatDate(date: Date): string; declare function formatDateHuman(date: Date): string; /** * The purpose of this function is to allow a list of short keywords * expand to longer bem class names with will then be applied to the classname value. * * This function will map a list of keys to values in a MAPPING list. * Whatever value is found will replace the keyword. * Every keyword not found will just transfered wiithmout modifying. */ declare function mapClassNames(value: string, DEFAULTS?: string[], MAPPING?: {}): string; declare function getClassNameList(value: string, MAPPING?: { [k: string]: string; }): string[]; /** * Add classes to the native element using the provided renderer. */ declare function appendClasses(renderer: Renderer2, element: ElementRef, classes: string): void; /** * Remove classes from the native element using the provided renderer. */ declare function removeClasses(renderer: Renderer2, element: ElementRef, classes: string): void; /** * Create a new `Date` instance using the provided value. */ declare function parseDate(dateString: string | number | Date): Date; /** * Manually compose a font shorthand defintion as it's not guaranteed to be given by the computed style object. */ declare function getFontShorthand(style: CSSStyleDeclaration): string; /** * Return the number of decimal places of a number. */ declare function numberOfDecimals(number: string | number): number; /** * Return the provided value if in specified range, the lower or upper boundary otherwise. */ declare function clamp(value: number, min?: number, max?: number): number; /** * Generate a random string. */ declare function randomString(): string; /** Available breakpoints to subscribe to. */ declare enum NxBreakpoints { /** Min size for BREAKPOINT_MOBILE */ BREAKPOINT_XSMALL = 0, BREAKPOINT_SMALL = 320, /** Min size for BREAKPOINT_TABLET */ BREAKPOINT_MEDIUM = 704, /** Min size for BREAKPOINT_DESKTOP */ BREAKPOINT_LARGE = 992, BREAKPOINT_XLARGE = 1280, BREAKPOINT_2XLARGE = 1472, BREAKPOINT_3XLARGE = 1760 } /** * Service subscribing to window resize events and providing breakpoint matching functions. */ declare class NxViewportService { private _platform; readonly viewportChange$: Observable; /** Returns whether the current viewport width is greater than or equal (>=) to minSize. */ min(minSize: NxBreakpoints, throttleTimeMs?: number): Observable; /** Returns whether the current viewport width is lower (<) than maxSize. */ max(maxSize: NxBreakpoints, throttleTimeMs?: number): Observable; /** Returns whether the current viewport width is greater than or equal (>=) to minSize and lower (<) than maxSize. */ between(minSize: NxBreakpoints, maxSize: NxBreakpoints, throttleTimeMs?: number): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { ErrorStateMatcher, FakeScrollStrategy, NxBreakpoints, NxViewportService, appendClasses, clamp, fakeScrollStrategyFunction, formatDate, formatDateHuman, getClassNameList, getFontShorthand, isBoolean, isFalse, isNull, isNullable, isNumber, isString, isTrue, isTruthy, isUndefined, mapClassNames, notEmpty, notNull, notNullable, notUndefined, numberOfDecimals, pad, parseDate, randomString, removeClasses };