UNPKG

2.64 kBTypeScriptView Raw
1/*! firebase-admin v10.0.0 */
2/*!
3 * Copyright 2021 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17import { App } from '../app';
18import { RulesFile as TRulesFile, Ruleset as TRuleset, RulesetMetadata as TRulesetMetadata, RulesetMetadataList as TRulesetMetadataList, SecurityRules as TSecurityRules } from './security-rules';
19/**
20 * Gets the {@link firebase-admin.security-rules#SecurityRules} service for the default
21 * app or a given app.
22 *
23 * `admin.securityRules()` can be called with no arguments to access the
24 * default app's {@link firebase-admin.security-rules#SecurityRules}
25 * service, or as `admin.securityRules(app)` to access
26 * the {@link firebase-admin.security-rules#SecurityRules}
27 * service associated with a specific app.
28 *
29 * @example
30 * ```javascript
31 * // Get the SecurityRules service for the default app
32 * var defaultSecurityRules = admin.securityRules();
33 * ```
34 *
35 * @example
36 * ```javascript
37 * // Get the SecurityRules service for a given app
38 * var otherSecurityRules = admin.securityRules(otherApp);
39 * ```
40 *
41 * @param app - Optional app to return the `SecurityRules` service
42 * for. If not provided, the default `SecurityRules` service
43 * is returned.
44 * @returns The default `SecurityRules` service if no app is provided, or the
45 * `SecurityRules` service associated with the provided app.
46 */
47export declare function securityRules(app?: App): securityRules.SecurityRules;
48export declare namespace securityRules {
49 /**
50 * Type alias to {@link firebase-admin.security-rules#RulesFile}.
51 */
52 type RulesFile = TRulesFile;
53 /**
54 * Type alias to {@link firebase-admin.security-rules#Ruleset}.
55 */
56 type Ruleset = TRuleset;
57 /**
58 * Type alias to {@link firebase-admin.security-rules#RulesetMetadata}.
59 */
60 type RulesetMetadata = TRulesetMetadata;
61 /**
62 * Type alias to {@link firebase-admin.security-rules#RulesetMetadataList}.
63 */
64 type RulesetMetadataList = TRulesetMetadataList;
65 /**
66 * Type alias to {@link firebase-admin.security-rules#SecurityRules}.
67 */
68 type SecurityRules = TSecurityRules;
69}