Skip to content

Commit

Permalink
Add AST for quieries
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jun 16, 2022
1 parent 10f043e commit 9bb6908
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 471 deletions.
19 changes: 12 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ declare function browserslist(
opts?: browserslist.Options
): string[]

interface Parser {
QUERIES: Record<string, RegExp>
parse(queries: string[]): object[]
}

declare namespace browserslist {
interface Query {
compose: 'or' | 'and'
type: string
query: string
not?: true
}

interface Options {
/**
* Path to processed file. It will be used to find config files.
Expand Down Expand Up @@ -149,6 +151,11 @@ declare namespace browserslist {
*/
function coverage(browsers: readonly string[], stats?: StatsOptions): number

function parse(
queries?: string | readonly string[] | null,
opts?: browserslist.Options
): Query[]

function clearCaches(): void

function parseConfig(string: string): Config
Expand All @@ -164,8 +171,6 @@ declare namespace browserslist {
}

function loadConfig(options: LoadConfigOptions): string[] | undefined

let parser: Parser
}

declare global {
Expand Down
Loading

0 comments on commit 9bb6908

Please sign in to comment.