UNPKG

@ynmstudio/utils

Version:
70 lines (69 loc) 2.07 kB
import { ChangeDetectorRef, EventEmitter } from '@angular/core'; import * as i0 from "@angular/core"; /** * A directive used to add an `active` class to a nav item * when the section is in the viewport * * @example * ```html * <a snScrollSpyItem for="foo" href="#section1">Section 1</a> * ``` * */ export declare class ScrollSpyItemDirective { private cdRef; private activeClass; /** * True if the nav item is the active item in the `items` list * for `ScrollSpyDirective` instance * * @memberof ScrollSpyItemDirective */ get getActiveClass(): string; /** * Emits when the `active` property changes */ activeChange: EventEmitter<boolean>; private _active; set active(state: boolean); get active(): boolean; set snScrollSpyItemActive(data: string); /** * ID of `ScrollSpyDirective` instance * * @memberof ScrollSpyItemDirective */ for: string; /** * Hash for section to link to * * @memberof ScrollSpyItemDirective */ href: string; /** * If true means the section is in the viewport * * @memberof ScrollSpyItemDirective */ inViewport: boolean; /** * Id of section that links navigates to * * @readonly * @memberof ScrollSpyItemDirective */ get section(): string; /** * Creates an instance of ScrollSpyItemDirective. * @memberof ScrollSpyItemDirective */ constructor(cdRef: ChangeDetectorRef); /** * Manually trigger change detection * * @memberof ScrollSpyItemDirective */ detectChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ScrollSpyItemDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ScrollSpyItemDirective, "[snScrollSpyItem]", never, { "snScrollSpyItemActive": { "alias": "snScrollSpyItemActive"; "required": false; }; "for": { "alias": "for"; "required": false; }; "href": { "alias": "href"; "required": false; }; }, { "activeChange": "activeChange"; }, never, never, true, never>; }