UNPKG

1.48 kBTypeScriptView Raw
1import { InjectionToken } from '@angular/core';
2import { Observable } from 'rxjs';
3import * as i0 from "@angular/core";
4/**
5 * Layout direction.
6 * */
7export declare enum NbLayoutDirection {
8 LTR = "ltr",
9 RTL = "rtl"
10}
11/**
12 * Layout direction setting injection token.
13 * */
14export declare const NB_LAYOUT_DIRECTION: InjectionToken<NbLayoutDirection>;
15/**
16 * Layout Direction Service.
17 * Allows to set or get layout direction and listen to its changes
18 */
19export declare class NbLayoutDirectionService {
20 private direction;
21 private $directionChange;
22 constructor(direction?: NbLayoutDirection);
23 /**
24 * Returns true if layout direction set to left to right.
25 * @returns boolean.
26 * */
27 isLtr(): boolean;
28 /**
29 * Returns true if layout direction set to right to left.
30 * @returns boolean.
31 * */
32 isRtl(): boolean;
33 /**
34 * Returns current layout direction.
35 * @returns NbLayoutDirection.
36 * */
37 getDirection(): NbLayoutDirection;
38 /**
39 * Sets layout direction
40 * @param {NbLayoutDirection} direction
41 */
42 setDirection(direction: NbLayoutDirection): void;
43 /**
44 * Triggered when direction was changed.
45 * @returns Observable<NbLayoutDirection>.
46 */
47 onDirectionChange(): Observable<NbLayoutDirection>;
48 static ɵfac: i0.ɵɵFactoryDeclaration<NbLayoutDirectionService, [{ optional: true; }]>;
49 static ɵprov: i0.ɵɵInjectableDeclaration<NbLayoutDirectionService>;
50}