1# Copyright 2022 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4"""Module for shared/commonly used type hinting.""" 5 6from typing import Any, Dict, List, Tuple 7 8TagTupleType = Tuple[str, ...] 9 10# Sample: 11# { 12# 'test_suite': { 13# 'test_name': { 14# ('typ', 'tags', 'as', 'tuple'): [ 'list', 'of', 'urls' ], 15# }, 16# }, 17# } 18TagsToUrlsType = Dict[TagTupleType, List[str]] 19TestToTagsType = Dict[str, TagsToUrlsType] 20AggregatedResultsType = Dict[str, TestToTagsType] 21 22# Sample: 23# { 24# typ_tags (tuple): { 25# test_name (str): result_count (int) 26# } 27# } 28TestToResultCountType = Dict[str, int] 29ResultCountType = Dict[TagTupleType, TestToResultCountType] 30 31SingleQueryResultType = Dict[str, Any] 32QueryJsonType = List[SingleQueryResultType] 33