UNPKG

1.52 kBTypeScriptView Raw
1/**
2 * Copyright 2018 Google Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { OmniHandler, StandardHandler, BuiltinFrameworks } from './framework';
17/** @public */
18export declare type AppHandler = OmniHandler & BaseApp;
19/** @public */
20export interface AppOptions {
21 /** @public */
22 debug?: boolean;
23}
24/** @hidden */
25export interface ServiceBaseApp {
26 /** @public */
27 handler: StandardHandler;
28}
29/** @public */
30export interface Plugin<TService, TPlugin> {
31 /** @public */
32 <TApp>(app: AppHandler & TService & TApp): (AppHandler & TService & TApp & TPlugin) | void;
33}
34/** @public */
35export interface BaseApp extends ServiceBaseApp {
36 /** @public */
37 frameworks: BuiltinFrameworks;
38 /** @public */
39 use<TService, TPlugin>(plugin: Plugin<TService, TPlugin>): this & TPlugin;
40 /** @public */
41 debug: boolean;
42}
43/** @hidden */
44export declare const attach: <TService>(service: TService, options?: AppOptions) => OmniHandler & BaseApp & TService;