ngx-slice-kit
Version:
[](https://badge.fury.io/js/ngx-slice-kit)
55 lines (54 loc) • 1.63 kB
TypeScript
import { Observable } from 'rxjs';
import { Theme } from './theme.model';
import * as i0 from "@angular/core";
export declare class ThemeService {
private $themes;
private $currentTheme;
constructor();
get themes(): Theme[];
get themesObservable(): Observable<Theme[]>;
get currentTheme(): Theme;
set currentTheme(t: Theme);
get themeName(): string;
get currentThemeObservable(): Observable<Theme>;
get darkness(): boolean;
/**
* check if there is saved theme, then looks it up at theme repository
*/
getDefaultTheme(): Theme;
/**
* Find theme by specified theme
* Always returns 'light' theme if no results
*/
findTheme(name: string): Theme;
/**
* returns current theme index
*/
getCurrentThemeIndex(): number;
/**
* Switch to next theme, find current index
* and if (current + 1) is out of index expression just go to themes[0]
*/
nextTheme(): void;
/**
* Sets specified specified theme by name
*
* @param name is required
*/
setTheme(name: string): void;
/**
* Gets value of specified theme property
*
* @param propName is required
*/
getProperty(propName: string): string;
/**
* Registers new theme in service memory
* @param theme contains new Theme references
* cannot be named as `light`, `dark` or any default themes
*/
registerTheme(theme: Theme): void;
updateTheme(t: Theme): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
}