UNPKG

1.51 kBTypeScriptView Raw
1import * as i0 from "@angular/core";
2/**
3 * Media breakpoint type
4 *
5 * Where `name` - breakpoint name alias (e.g. xs, sm, md, etc), and width - min breakpoint width
6 */
7export interface NbMediaBreakpoint {
8 name: string;
9 width: number;
10}
11export declare const DEFAULT_MEDIA_BREAKPOINTS: {
12 name: string;
13 width: number;
14}[];
15/**
16 * Manages media breakpoints
17 *
18 * Provides access to available media breakpoints to convert window width to a configured breakpoint,
19 * e.g. 200px - *xs* breakpoint
20 */
21export declare class NbMediaBreakpointsService {
22 private breakpoints;
23 private breakpointsMap;
24 constructor(breakpoints: any);
25 /**
26 * Returns a configured breakpoint by width
27 * @param width number
28 * @returns {Z|{name: string, width: number}}
29 */
30 getByWidth(width: number): NbMediaBreakpoint;
31 /**
32 * Returns a configured breakpoint by name
33 * @param name string
34 * @returns NbMediaBreakpoint
35 */
36 getByName(name: string): NbMediaBreakpoint;
37 /**
38 * Returns a list of configured breakpoints for the theme
39 * @returns NbMediaBreakpoint[]
40 */
41 getBreakpoints(): NbMediaBreakpoint[];
42 /**
43 * Returns a map of configured breakpoints for the theme
44 * @returns {[p: string]: number}
45 */
46 getBreakpointsMap(): {
47 [breakpoint: string]: number;
48 };
49 static ɵfac: i0.ɵɵFactoryDeclaration<NbMediaBreakpointsService, never>;
50 static ɵprov: i0.ɵɵInjectableDeclaration<NbMediaBreakpointsService>;
51}