-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsearch-api-types.ts
More file actions
99 lines (89 loc) · 2.67 KB
/
search-api-types.ts
File metadata and controls
99 lines (89 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
export enum UrlParams {
Combinator = 'combinator',
SearchType = 'search-type',
SelectedWords = 'selected-words',
ExcludedWords = 'excluded-words',
Taxon = 'taxon',
Person = 'person',
PublishingOrganisation = 'publishing-organisation',
CaseSensitive = 'case-sensitive',
DocumentType = 'document-type',
KeywordLocation = 'keyword-location',
LinkSearchUrl = 'link-search-url',
PhoneNumber = 'phone-number',
PublishingApplication = 'publishing-application',
PublishingStatus = 'publishing-status',
Language = 'language',
PoliticalStatus = 'political-status',
Government = 'government',
}
export enum SearchType {
Keyword = 'keyword',
Link = 'link',
PhoneNumber = 'phone-number',
Organisation = 'organisation',
Taxon = 'taxon',
Person = 'person',
Language = 'language',
Advanced = 'advanced',
Results = 'results',
}
export enum Combinator {
Any = 'any',
All = 'all',
NotSet = 'notset',
}
export enum KeywordLocation {
All = 'all',
Title = 'title',
Description = 'description',
BodyContent = 'bodycontent',
}
export enum PublishingStatus {
Withdrawn = 'withdrawn',
NotWithdrawn = 'notWithdrawn',
All = 'all',
}
export enum PublishingApplication {
Any = 'any',
Whitehall = 'whitehall',
Publisher = 'publisher',
}
export enum PoliticalStatus {
Any = 'any',
Political = 'political',
NotPolitical = 'notPolitical',
}
export type SearchParams = {
searchType: SearchType
selectedWords: string // list of words to search
excludedWords: string // list of words to exclude
taxon: string // taxon to search in
person: string // person whose pages to search
publishingOrganisation: string // organisation to search in
language: string // the language to search for
documentType: string // documentTypeto search in
linkSearchUrl: string // URL to find all pages linking to
phoneNumber: string // the phone number to search for
keywordLocation: KeywordLocation // what parts of the pages to search in
combinator: Combinator // all keywords or any keywords
publishingApplication: PublishingApplication // whitehall, publisher, both
caseSensitive: boolean // case sensitive keyword search?
publishingStatus: PublishingStatus // Withdrawn, not withdrawn etc.
politicalStatus: PoliticalStatus // page is politial: true, false, null
government: string // government that published the page.
}
// a search can return a variable number of records of any type
export type SearchResults = unknown[]
export type InitResults = {
taxons: string[]
people: string[]
locales: string[]
organisations: string[]
documentTypes: string[]
governments: string[]
}
export type Occurrence = {
keyword: string[]
occurrences: number[]
}