From c63b34fe859f9a98655bd63e5aa98c871d7b6620 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Fri, 20 May 2022 15:36:02 +0200 Subject: [PATCH] feat(techdocs): define style rule options Signed-off-by: Camila Belo --- .../reader/transformers/styles/rules/types.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/techdocs/src/reader/transformers/styles/rules/types.ts diff --git a/plugins/techdocs/src/reader/transformers/styles/rules/types.ts b/plugins/techdocs/src/reader/transformers/styles/rules/types.ts new file mode 100644 index 0000000000..6419ef8e39 --- /dev/null +++ b/plugins/techdocs/src/reader/transformers/styles/rules/types.ts @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BackstageTheme } from '@backstage/theme'; + +/** + * A Backstage sidebar object that contains properties such as its pin state. + */ +type BackstageSidebar = { + /** Tracks whether the user pinned the sidebar or not. */ + isPinned: boolean; +}; + +/** + * A dependencies object injected into rules by the style processor. + */ +export type RuleOptions = { + /** + * A Backstage theme object that contains the application's design tokens. + */ + theme: BackstageTheme; + /** + * A Backstage sidebar, see {@link BackstageSidebar} for more details. + */ + sidebar: BackstageSidebar; +};