@browserbasehq/sdk 1.4.2 → 1.4.3-next.0

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.
Files changed (39) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +3 -1
  3. package/dist/recorder/call-metadata.d.ts +66 -0
  4. package/dist/recorder/call-metadata.js +2 -0
  5. package/dist/recorder/crypto.d.ts +1 -0
  6. package/dist/recorder/crypto.js +10 -0
  7. package/dist/recorder/css-utils.d.ts +2 -0
  8. package/dist/recorder/css-utils.js +34 -0
  9. package/dist/recorder/generator.d.ts +31 -0
  10. package/dist/recorder/generator.js +154 -0
  11. package/dist/recorder/javascript-generator.d.ts +29 -0
  12. package/dist/recorder/javascript-generator.js +256 -0
  13. package/dist/recorder/language.d.ts +127 -0
  14. package/dist/recorder/language.js +21 -0
  15. package/dist/recorder/recorder-types.d.ts +108 -0
  16. package/dist/recorder/recorder-types.js +2 -0
  17. package/dist/recorder/recorder.d.ts +35 -0
  18. package/dist/recorder/recorder.js +333 -0
  19. package/dist/recorder/time.d.ts +1 -0
  20. package/dist/recorder/time.js +42 -0
  21. package/dist/recorder/timeout-runner.d.ts +6 -0
  22. package/dist/recorder/timeout-runner.js +19 -0
  23. package/dist/recorder/utils/isomorphic/css-parser.d.ts +41 -0
  24. package/dist/recorder/utils/isomorphic/css-parser.js +291 -0
  25. package/dist/recorder/utils/isomorphic/css-tokenizer.d.ts +171 -0
  26. package/dist/recorder/utils/isomorphic/css-tokenizer.js +986 -0
  27. package/dist/recorder/utils/isomorphic/locator-generators.d.ts +79 -0
  28. package/dist/recorder/utils/isomorphic/locator-generators.js +666 -0
  29. package/dist/recorder/utils/isomorphic/locator-parser.d.ts +17 -0
  30. package/dist/recorder/utils/isomorphic/locator-parser.js +244 -0
  31. package/dist/recorder/utils/isomorphic/locator-utils.d.ts +43 -0
  32. package/dist/recorder/utils/isomorphic/locator-utils.js +69 -0
  33. package/dist/recorder/utils/isomorphic/selector-parser.d.ts +48 -0
  34. package/dist/recorder/utils/isomorphic/selector-parser.js +483 -0
  35. package/dist/recorder/utils/isomorphic/string-utils.d.ts +28 -0
  36. package/dist/recorder/utils/isomorphic/string-utils.js +123 -0
  37. package/dist/recorder/utils.d.ts +20 -0
  38. package/dist/recorder/utils.js +32 -0
  39. package/package.json +6 -2
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl';
17
+ export type LocatorType = 'default' | 'role' | 'text' | 'label' | 'placeholder' | 'alt' | 'title' | 'test-id' | 'nth' | 'first' | 'last' | 'has-text' | 'has-not-text' | 'has' | 'hasNot' | 'frame' | 'and' | 'or' | 'chain';
18
+ export type LocatorBase = 'page' | 'locator' | 'frame-locator';
19
+ export type Quote = "'" | '"' | '`';
20
+ type LocatorOptions = {
21
+ attrs?: {
22
+ name: string;
23
+ value: string | boolean | number;
24
+ }[];
25
+ exact?: boolean;
26
+ name?: string | RegExp;
27
+ hasText?: string | RegExp;
28
+ hasNotText?: string | RegExp;
29
+ };
30
+ export interface LocatorFactory {
31
+ generateLocator(base: LocatorBase, kind: LocatorType, body: string | RegExp, options?: LocatorOptions): string;
32
+ chainLocators(locators: string[]): string;
33
+ }
34
+ export declare function asLocator(lang: Language, selector: string, isFrameLocator?: boolean): string;
35
+ export declare function asLocators(lang: Language, selector: string, isFrameLocator?: boolean, maxOutputSize?: number, preferredQuote?: Quote): string[];
36
+ export declare class JavaScriptLocatorFactory implements LocatorFactory {
37
+ private preferredQuote?;
38
+ constructor(preferredQuote?: Quote);
39
+ generateLocator(base: LocatorBase, kind: LocatorType, body: string | RegExp, options?: LocatorOptions): string;
40
+ chainLocators(locators: string[]): string;
41
+ private regexToSourceString;
42
+ private toCallWithExact;
43
+ private toHasText;
44
+ private toTestIdValue;
45
+ private quote;
46
+ }
47
+ export declare class PythonLocatorFactory implements LocatorFactory {
48
+ generateLocator(base: LocatorBase, kind: LocatorType, body: string | RegExp, options?: LocatorOptions): string;
49
+ chainLocators(locators: string[]): string;
50
+ private regexToString;
51
+ private toCallWithExact;
52
+ private toHasText;
53
+ private toTestIdValue;
54
+ private quote;
55
+ }
56
+ export declare class JavaLocatorFactory implements LocatorFactory {
57
+ generateLocator(base: LocatorBase, kind: LocatorType, body: string | RegExp, options?: LocatorOptions): string;
58
+ chainLocators(locators: string[]): string;
59
+ private regexToString;
60
+ private toCallWithExact;
61
+ private toHasText;
62
+ private toTestIdValue;
63
+ private quote;
64
+ }
65
+ export declare class CSharpLocatorFactory implements LocatorFactory {
66
+ generateLocator(base: LocatorBase, kind: LocatorType, body: string | RegExp, options?: LocatorOptions): string;
67
+ chainLocators(locators: string[]): string;
68
+ private regexToString;
69
+ private toCallWithExact;
70
+ private toHasText;
71
+ private toTestIdValue;
72
+ private toHasNotText;
73
+ private quote;
74
+ }
75
+ export declare class JsonlLocatorFactory implements LocatorFactory {
76
+ generateLocator(base: LocatorBase, kind: LocatorType, body: string | RegExp, options?: LocatorOptions): string;
77
+ chainLocators(locators: string[]): string;
78
+ }
79
+ export {};