/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { LiveAnnouncer } from '@angular/cdk/a11y'; import { BreakpointObserver } from '@angular/cdk/layout'; import { Overlay } from '@angular/cdk/overlay'; import { ComponentType } from '@angular/cdk/portal'; import { EmbeddedViewRef, InjectionToken, Injector, TemplateRef, OnDestroy } from '@angular/core'; import { SCToastRef, SCToastAction } from './sc-toast-ref'; import { SCSimpleToast } from './sc-toast.component'; import { SCToastConfig } from './sc-toast-config'; import * as i0 from "@angular/core"; /** Injection token that can be used to specify default snack bar. */ export declare const MAT_SNACK_BAR_DEFAULT_OPTIONS: InjectionToken>; /** @docs-private */ export declare function MAT_SNACK_BAR_DEFAULT_OPTIONS_FACTORY(): SCToastConfig; /** * Service to dispatch SCerial Design snack bar messages. */ export declare class SCToastService implements OnDestroy { private _overlay; private _live; private _injector; private _breakpointObserver; private _parentToastService; private _defaultConfig; /** * Reference to the current snack bar in the view *at this level* (in the Angular injector tree). * If there is a parent snack-bar service, all operations should delegate to that parent * via `_openedToastRef`. */ private _toastRefsAtThisLevel; defaultMargin: number; isHovering: boolean; /** Reference to the currently opened snackbar at *any* level. */ get _openedToastRefs(): SCToastRef[] | null; set _openedToastRefs(value: SCToastRef[] | null); constructor(_overlay: Overlay, _live: LiveAnnouncer, _injector: Injector, _breakpointObserver: BreakpointObserver, _parentToastService: SCToastService, _defaultConfig: SCToastConfig); /** * Creates and dispatches a snack bar with a custom component for the content, removing any * currently opened snack bars. * * @param component Component to be instantiated. * @param config Extra configuration for the snack bar. */ openFromComponent(component: ComponentType, config?: SCToastConfig): SCToastRef; /** * Creates and dispatches a snack bar with a custom template for the content, removing any * currently opened snack bars. * * @param template Template to be instantiated. * @param config Extra configuration for the snack bar. */ openFromTemplate(template: TemplateRef, config?: SCToastConfig): SCToastRef>; /** * Opens a snackbar with a message and an optional action. * @param message The message to show in the snackbar. * @param action The label for the snackbar action. * @param config Additional configuration options for the snackbar. */ open(message: string, actions?: SCToastAction[], config?: SCToastConfig, index?: string, closeOthersOnIndex?: boolean): SCToastRef; /** * Dismisses the currently-visible snack bar. */ dismiss(): void; ngOnDestroy(): void; /** * Attaches the snack bar container component to the overlay. */ private _attachToastContainer; /** * Places a new component or a template as the content of the snack bar container. */ private _attach; /** Animates the old snack bar out and the new one in. */ private _animateToast; /** * Creates a new overlay and places it in the correct location. * @param config The user-specified snack bar config. */ private _createOverlay; /** * Creates an injector to be used inside of a snack bar component. * @param config Config that was used to create the snack bar. * @param toastRef Reference to the snack bar. */ private _createInjector; calculateToastPositions(): void; handleMouseLeave(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }