@screw-bugs/core 0.0.0-stage → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -2
- package/dist/core/accounts.d.ts +40 -0
- package/dist/core/accounts.js +95 -0
- package/dist/core/css.d.ts +95 -0
- package/dist/core/css.js +436 -0
- package/dist/core/engine.d.ts +75 -0
- package/dist/core/engine.js +560 -0
- package/dist/core/errors.d.ts +85 -0
- package/dist/core/errors.js +36 -0
- package/dist/core/evidence.d.ts +14 -0
- package/dist/core/evidence.js +131 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.js +14 -0
- package/dist/core/labels.d.ts +47 -0
- package/dist/core/labels.js +199 -0
- package/dist/core/liveness.d.ts +45 -0
- package/dist/core/liveness.js +66 -0
- package/dist/core/marks.d.ts +63 -0
- package/dist/core/marks.js +410 -0
- package/dist/core/services.d.ts +579 -0
- package/dist/core/services.js +25 -0
- package/dist/core/share.d.ts +68 -0
- package/dist/core/share.js +318 -0
- package/dist/core/steps.d.ts +106 -0
- package/dist/core/steps.js +722 -0
- package/dist/core/uploads.d.ts +49 -0
- package/dist/core/uploads.js +133 -0
- package/dist/core/video.d.ts +53 -0
- package/dist/core/video.js +241 -0
- package/dist/core/viewport.d.ts +28 -0
- package/dist/core/viewport.js +50 -0
- package/dist/report/assets.d.ts +40 -0
- package/dist/report/assets.js +105 -0
- package/dist/report/bug.d.ts +11 -0
- package/dist/report/bug.js +20 -0
- package/dist/report/html.d.ts +52 -0
- package/dist/report/html.js +928 -0
- package/dist/report/icons.d.ts +51 -0
- package/dist/report/icons.js +93 -0
- package/dist/report/index.d.ts +10 -0
- package/dist/report/index.js +10 -0
- package/dist/report/live.d.ts +7 -0
- package/dist/report/live.js +135 -0
- package/dist/report/logos.d.ts +4 -0
- package/dist/report/logos.js +19 -0
- package/dist/report/markup.d.ts +50 -0
- package/dist/report/markup.js +156 -0
- package/dist/report/menu-bar.d.ts +61 -0
- package/dist/report/menu-bar.js +158 -0
- package/dist/report/player.d.ts +102 -0
- package/dist/report/player.js +315 -0
- package/dist/report/pr-summary.d.ts +11 -0
- package/dist/report/pr-summary.js +119 -0
- package/dist/report/sha256.d.ts +9 -0
- package/dist/report/sha256.js +97 -0
- package/dist/report/share-page.d.ts +48 -0
- package/dist/report/share-page.js +307 -0
- package/dist/report/shots.d.ts +59 -0
- package/dist/report/shots.js +280 -0
- package/dist/report/sign-in.d.ts +42 -0
- package/dist/report/sign-in.js +532 -0
- package/dist/report/styles.d.ts +3 -0
- package/dist/report/styles.js +274 -0
- package/dist/report/view.d.ts +296 -0
- package/dist/report/view.js +702 -0
- package/dist/report/walkthrough.d.ts +93 -0
- package/dist/report/walkthrough.js +716 -0
- package/dist/schema/accounts.d.ts +137 -0
- package/dist/schema/accounts.js +121 -0
- package/dist/schema/config.d.ts +7 -0
- package/dist/schema/config.js +6 -0
- package/dist/schema/doctor.d.ts +46 -0
- package/dist/schema/doctor.js +31 -0
- package/dist/schema/evidence.d.ts +1115 -0
- package/dist/schema/evidence.js +565 -0
- package/dist/schema/findings.d.ts +161 -0
- package/dist/schema/findings.js +82 -0
- package/dist/schema/index.d.ts +9 -0
- package/dist/schema/index.js +9 -0
- package/dist/schema/job.d.ts +1905 -0
- package/dist/schema/job.js +577 -0
- package/dist/schema/ledger.d.ts +1124 -0
- package/dist/schema/ledger.js +285 -0
- package/dist/schema/share.d.ts +55 -0
- package/dist/schema/share.js +64 -0
- package/dist/schema/status.d.ts +7 -0
- package/dist/schema/status.js +11 -0
- package/package.json +46 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UX studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @screw-bugs/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The platform-free part of [screw-bugs](https://github.com/uxstudioteam/screw-bugs): the job and
|
|
4
|
+
report bundle schemas, the run engine with its service interfaces, and the report renderer. Its
|
|
5
|
+
only dependency is [`effect`](https://effect.website), and it runs anywhere modern JavaScript does,
|
|
6
|
+
Cloudflare Workers included: no Node built-ins or globals, no Playwright.
|
|
7
|
+
|
|
8
|
+
`screw-bugs` (the CLI and MCP server) depends on it and re-exports it; screw-bugs Cloud uses it to
|
|
9
|
+
render shared reports and run jobs with its own browser and storage. Both make the same report
|
|
10
|
+
bundle (`ReportBundle`), so a report looks the same wherever it was made.
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm i @screw-bugs/core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Import | What it has |
|
|
17
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `@screw-bugs/core/schema` | Schemas of every file a run reads or writes: `JobSpec`, `CaseLedger`, `ReportBundle`, `Findings`, ... |
|
|
19
|
+
| `@screw-bugs/core/core` | The engine (`runJob`, `runCase`) and the services it runs on (`Browser`, `Storage`, `ReportRenderer`, `Clock`, ...) |
|
|
20
|
+
| `@screw-bugs/core/report` | The renderers: `renderHtmlReport`, `renderWalkthrough`, `renderPrSummary`, `renderLivePage`, ... |
|
|
21
|
+
| `@screw-bugs/core` | The same as `@screw-bugs/core/core` |
|
|
22
|
+
|
|
23
|
+
A host whose pages are already on screw-bugs Cloud renders them with `{ share: false }`
|
|
24
|
+
(`renderHtmlReport(bundle, { assetBaseUrl, share: false })`, and the same for
|
|
25
|
+
`renderWalkthrough`; for the engine, the layer `reportRendererHtml({ assetBaseUrl, share: false })`
|
|
26
|
+
in place of `ReportRendererHtml`), which leaves out the Share button: it puts a run on Cloud
|
|
27
|
+
through the local report server, so it has no use there.
|
|
28
|
+
|
|
29
|
+
Its version is always the screw-bugs version it was released with. A renderer reads every bundle of
|
|
30
|
+
its minor line (see `RELEASING.md` in the repository).
|
|
31
|
+
|
|
32
|
+
`pnpm --filter @screw-bugs/core check:workers` (part of the repository's `pnpm check`) bundles every
|
|
33
|
+
entry for a Workers target, failing on any Node built-in or other package, then renders a report in
|
|
34
|
+
a JavaScript context that has only the globals Workers have.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SavedAccount } from './services.js';
|
|
2
|
+
import { type JobAccount, type SavedSession, type SignInWhy } from '../schema/index.js';
|
|
3
|
+
/** How recent a session counts as just signed in, so `renew` does not ask for it again. */
|
|
4
|
+
export declare const RENEW_GRACE_MS: number;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the browser sends a cookie of `domain` (as Playwright gives it) to `origin`'s host. A
|
|
7
|
+
* host-only cookie (no leading dot) goes to its own host alone; a domain cookie (`.acme.dev`) to
|
|
8
|
+
* that host and every name under it (RFC 6265 domain matching). Browsers never keep a cookie for
|
|
9
|
+
* a public suffix (`co.uk`, `github.io`), so this never takes in another site that shares one;
|
|
10
|
+
* a sibling's cookie (`api.acme.dev` for `app.acme.dev`), or the parent's own host-only one, is
|
|
11
|
+
* not kept either.
|
|
12
|
+
*/
|
|
13
|
+
export declare const sentTo: (origin: string, domain: string) => boolean;
|
|
14
|
+
/** The origin of a job URL, such as `http://localhost:3000`; undefined for one that is not a URL. */
|
|
15
|
+
export declare const originOf: (url: string) => string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Whether every cookie of the session has an expiry and it has passed: then the browser would
|
|
18
|
+
* start with none of them, and the session cannot work. A session with no cookies at all may
|
|
19
|
+
* live in storage, so it counts as working.
|
|
20
|
+
*/
|
|
21
|
+
export declare const sessionExpired: (session: Pick<SavedSession, 'cookies'>, nowMs: number) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Why a run of a job with `account` at `url` cannot start from its saved session yet (a person has
|
|
24
|
+
* to sign in to it first), or undefined when it can.
|
|
25
|
+
*/
|
|
26
|
+
export declare const needsSignIn: (account: JobAccount, url: string, saved: SavedAccount | undefined, nowMs: number) => SignInWhy | undefined;
|
|
27
|
+
/** What kind of user the account is: what the job says, else what was saved. */
|
|
28
|
+
export declare const aboutOf: (account: JobAccount, saved: SavedAccount | undefined) => string | undefined;
|
|
29
|
+
/** Why the account needs signing in, as the end of a sentence about it. */
|
|
30
|
+
export declare const describeSignInWhy: (why: SignInWhy) => string;
|
|
31
|
+
/** At most this long, the app's title as the live view shows it. */
|
|
32
|
+
export declare const SITE_TITLE_MAX = 120;
|
|
33
|
+
/** A page title on one line, cut to `SITE_TITLE_MAX`; undefined when blank. */
|
|
34
|
+
export declare const siteTitle: (raw: string) => string | undefined;
|
|
35
|
+
/** At most this many icon addresses are tried, best first. */
|
|
36
|
+
export declare const SITE_ICONS_MAX = 4;
|
|
37
|
+
/** The largest icon the live view shows, in bytes. */
|
|
38
|
+
export declare const SITE_ICON_BYTES_MAX: number;
|
|
39
|
+
/** The image type of an icon from its `Content-Type`, or undefined when it is not one shown. */
|
|
40
|
+
export declare const siteIconType: (contentType: string | undefined) => string | undefined;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { DateTime, Option } from 'effect';
|
|
2
|
+
import { accountAboutOf, } from '../schema/index.js';
|
|
3
|
+
/** How recent a session counts as just signed in, so `renew` does not ask for it again. */
|
|
4
|
+
export const RENEW_GRACE_MS = 10 * 60_000;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the browser sends a cookie of `domain` (as Playwright gives it) to `origin`'s host. A
|
|
7
|
+
* host-only cookie (no leading dot) goes to its own host alone; a domain cookie (`.acme.dev`) to
|
|
8
|
+
* that host and every name under it (RFC 6265 domain matching). Browsers never keep a cookie for
|
|
9
|
+
* a public suffix (`co.uk`, `github.io`), so this never takes in another site that shares one;
|
|
10
|
+
* a sibling's cookie (`api.acme.dev` for `app.acme.dev`), or the parent's own host-only one, is
|
|
11
|
+
* not kept either.
|
|
12
|
+
*/
|
|
13
|
+
export const sentTo = (origin, domain) => {
|
|
14
|
+
const host = URL.parse(origin)
|
|
15
|
+
?.hostname.toLowerCase()
|
|
16
|
+
.replace(/^\[|\]$/g, '');
|
|
17
|
+
const lower = domain.toLowerCase().replace(/\.$/, '');
|
|
18
|
+
const bare = lower.replace(/^\./, '');
|
|
19
|
+
if (host === undefined || bare === '')
|
|
20
|
+
return false;
|
|
21
|
+
return host === bare || (lower.startsWith('.') && host.endsWith(`.${bare}`));
|
|
22
|
+
};
|
|
23
|
+
/** The origin of a job URL, such as `http://localhost:3000`; undefined for one that is not a URL. */
|
|
24
|
+
export const originOf = (url) => {
|
|
25
|
+
const parsed = URL.parse(url);
|
|
26
|
+
return parsed === null ? undefined : parsed.origin;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Whether every cookie of the session has an expiry and it has passed: then the browser would
|
|
30
|
+
* start with none of them, and the session cannot work. A session with no cookies at all may
|
|
31
|
+
* live in storage, so it counts as working.
|
|
32
|
+
*/
|
|
33
|
+
export const sessionExpired = (session, nowMs) => session.cookies.length > 0 &&
|
|
34
|
+
session.cookies.every((c) => c.expires > 0 && c.expires * 1000 <= nowMs);
|
|
35
|
+
/**
|
|
36
|
+
* Why a run of a job with `account` at `url` cannot start from its saved session yet (a person has
|
|
37
|
+
* to sign in to it first), or undefined when it can.
|
|
38
|
+
*/
|
|
39
|
+
export const needsSignIn = (account, url, saved, nowMs) => {
|
|
40
|
+
if (saved === undefined || saved.session === undefined)
|
|
41
|
+
return { _tag: 'none' };
|
|
42
|
+
if (saved.entry.origin !== originOf(url))
|
|
43
|
+
return { _tag: 'origin', saved: saved.entry.origin };
|
|
44
|
+
if (sessionExpired(saved.session, nowMs))
|
|
45
|
+
return { _tag: 'expired' };
|
|
46
|
+
const savedAt = Option.map(DateTime.make(saved.entry.savedAt), DateTime.toEpochMillis);
|
|
47
|
+
const renew = typeof account !== 'string' && account.renew === true;
|
|
48
|
+
const justSaved = Option.exists(savedAt, (at) => nowMs - at < RENEW_GRACE_MS);
|
|
49
|
+
if (renew && !justSaved)
|
|
50
|
+
return { _tag: 'renew' };
|
|
51
|
+
return undefined;
|
|
52
|
+
};
|
|
53
|
+
/** What kind of user the account is: what the job says, else what was saved. */
|
|
54
|
+
export const aboutOf = (account, saved) => accountAboutOf(account) ?? saved?.entry.about;
|
|
55
|
+
/** Why the account needs signing in, as the end of a sentence about it. */
|
|
56
|
+
export const describeSignInWhy = (why) => {
|
|
57
|
+
switch (why._tag) {
|
|
58
|
+
case 'none':
|
|
59
|
+
return 'has no saved sign-in yet';
|
|
60
|
+
case 'origin':
|
|
61
|
+
return `is signed in on ${why.saved}, not here`;
|
|
62
|
+
case 'expired':
|
|
63
|
+
return 'has a saved sign-in whose cookies have all expired';
|
|
64
|
+
case 'renew':
|
|
65
|
+
return 'was asked to sign in again';
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/** At most this long, the app's title as the live view shows it. */
|
|
69
|
+
export const SITE_TITLE_MAX = 120;
|
|
70
|
+
/** A page title on one line, cut to `SITE_TITLE_MAX`; undefined when blank. */
|
|
71
|
+
export const siteTitle = (raw) => {
|
|
72
|
+
const line = raw.replace(/\s+/g, ' ').trim();
|
|
73
|
+
if (line === '')
|
|
74
|
+
return undefined;
|
|
75
|
+
return line.length > SITE_TITLE_MAX ? `${line.slice(0, SITE_TITLE_MAX - 1)}…` : line;
|
|
76
|
+
};
|
|
77
|
+
/** At most this many icon addresses are tried, best first. */
|
|
78
|
+
export const SITE_ICONS_MAX = 4;
|
|
79
|
+
/** The largest icon the live view shows, in bytes. */
|
|
80
|
+
export const SITE_ICON_BYTES_MAX = 64 * 1024;
|
|
81
|
+
/** Image types an icon is shown as. It goes in an `<img>`, where even an SVG runs no script. */
|
|
82
|
+
const SITE_ICON_TYPES = new Set([
|
|
83
|
+
'image/png',
|
|
84
|
+
'image/x-icon',
|
|
85
|
+
'image/vnd.microsoft.icon',
|
|
86
|
+
'image/svg+xml',
|
|
87
|
+
'image/gif',
|
|
88
|
+
'image/jpeg',
|
|
89
|
+
'image/webp',
|
|
90
|
+
]);
|
|
91
|
+
/** The image type of an icon from its `Content-Type`, or undefined when it is not one shown. */
|
|
92
|
+
export const siteIconType = (contentType) => {
|
|
93
|
+
const type = contentType?.split(';')[0]?.trim().toLowerCase();
|
|
94
|
+
return type !== undefined && SITE_ICON_TYPES.has(type) ? type : undefined;
|
|
95
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** An attribute selector, such as `[data-test="preview"]` or `[href*=linkedin i]`. */
|
|
2
|
+
export interface AttributeTest {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** Undefined for `[name]`: the attribute is there, whatever its value. */
|
|
5
|
+
readonly op?: '=' | '~=' | '|=' | '^=' | '$=' | '*=';
|
|
6
|
+
readonly value?: string;
|
|
7
|
+
/** `i` compares ignoring ASCII case, `s` with it; without one, as HTML says for the attribute. */
|
|
8
|
+
readonly flag?: 'i' | 's';
|
|
9
|
+
}
|
|
10
|
+
/** One compound selector: everything about one element, such as `iframe.preview[title=Hi]`. */
|
|
11
|
+
export interface Compound {
|
|
12
|
+
/** Lower case; undefined for `*` or none. */
|
|
13
|
+
readonly tag?: string;
|
|
14
|
+
readonly ids: ReadonlyArray<string>;
|
|
15
|
+
readonly classes: ReadonlyArray<string>;
|
|
16
|
+
readonly attributes: ReadonlyArray<AttributeTest>;
|
|
17
|
+
readonly not: ReadonlyArray<Compound>;
|
|
18
|
+
}
|
|
19
|
+
/** A compound and how it relates to the one before it: inside it anywhere, or right inside it. */
|
|
20
|
+
export interface Part {
|
|
21
|
+
readonly compound: Compound;
|
|
22
|
+
/** How this part relates to the one before it; undefined for the first. */
|
|
23
|
+
readonly combinator?: 'descendant' | 'child';
|
|
24
|
+
}
|
|
25
|
+
/** A selector list: an element matches when it matches any of them, judged by its last part. */
|
|
26
|
+
export type Selector = ReadonlyArray<ReadonlyArray<Part>>;
|
|
27
|
+
/** A selector, or why it cannot be matched against saved page state, in words. */
|
|
28
|
+
export type Parsed = {
|
|
29
|
+
readonly _tag: 'selector';
|
|
30
|
+
readonly selector: Selector;
|
|
31
|
+
} | {
|
|
32
|
+
readonly _tag: 'unsupported';
|
|
33
|
+
readonly reason: string;
|
|
34
|
+
};
|
|
35
|
+
/** What a highlight's CSS can check, besides the element itself and the frame it is in. */
|
|
36
|
+
export declare const SUPPORTED_CSS: string;
|
|
37
|
+
/**
|
|
38
|
+
* Parses `css` into the selectors `matches` takes, or says in words what of it cannot be matched
|
|
39
|
+
* against saved page state (see `SUPPORTED_CSS`).
|
|
40
|
+
*/
|
|
41
|
+
export declare const parseSelector: (css: string) => Parsed;
|
|
42
|
+
/**
|
|
43
|
+
* An attribute's value as saved: `cut` when only its start was kept, so it is longer than `value`.
|
|
44
|
+
*/
|
|
45
|
+
export interface AttributeValue {
|
|
46
|
+
readonly value: string;
|
|
47
|
+
readonly cut?: boolean | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* An element as a selector sees it: its own attributes, and the element it is in. What was not
|
|
51
|
+
* saved whole is said, so a selector that depends on it is not taken as matching or not.
|
|
52
|
+
*/
|
|
53
|
+
export interface CssElement {
|
|
54
|
+
readonly tag: string;
|
|
55
|
+
readonly id?: string | undefined;
|
|
56
|
+
readonly classes?: ReadonlyArray<string> | undefined;
|
|
57
|
+
/** More classes than `classes` holds. */
|
|
58
|
+
readonly classesCut?: boolean | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* An attribute's value, undefined when it does not have it (as far as was saved), or `unsaved`
|
|
61
|
+
* when it has it but its value was not saved.
|
|
62
|
+
*/
|
|
63
|
+
readonly attribute: (name: string) => AttributeValue | 'unsaved' | undefined;
|
|
64
|
+
/** More attributes than were saved, so one `attribute` does not give may still be there. */
|
|
65
|
+
readonly attributesCut?: boolean | undefined;
|
|
66
|
+
/** Not an HTML element (such as an `<svg>`), whose attribute values HTML never folds. */
|
|
67
|
+
readonly foreign?: boolean | undefined;
|
|
68
|
+
/** The element it is in; undefined at the top of its document, or when that was not saved. */
|
|
69
|
+
readonly parent: () => CssElement | undefined;
|
|
70
|
+
/** It is in an element that was not saved, so `parent` stops short of the top. */
|
|
71
|
+
readonly parentCut?: boolean | undefined;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Whether something holds: true, false, or undefined when it depends on what was not saved (an
|
|
75
|
+
* attribute value cut short, attributes, classes or ancestors left out).
|
|
76
|
+
*/
|
|
77
|
+
export type Maybe = boolean | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Attributes whose values HTML compares ignoring ASCII case in selectors, on HTML elements, unless
|
|
80
|
+
* the selector says `s` (HTML's list of case-insensitive attribute values).
|
|
81
|
+
*/
|
|
82
|
+
export declare const CASE_INSENSITIVE_ATTRIBUTES: ReadonlySet<string>;
|
|
83
|
+
/** Whether `el` matches any selector of the list; undefined when that depends on what was not saved. */
|
|
84
|
+
export declare const selectorMatches: (selector: Selector, el: CssElement) => Maybe;
|
|
85
|
+
/** Whether the selector looks at an element's ancestors at all. */
|
|
86
|
+
export declare const usesAncestors: (selector: Selector) => boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The ID or test ID that every element matching `selector` exactly has, when it is one compound
|
|
89
|
+
* with one: what `Truncated.unsaved` can count.
|
|
90
|
+
*/
|
|
91
|
+
export declare const selectorKey: (selector: Selector) => {
|
|
92
|
+
readonly id: string;
|
|
93
|
+
} | {
|
|
94
|
+
readonly testId: string;
|
|
95
|
+
} | undefined;
|