@pi-r/android 0.7.3 → 0.8.1

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/types/index.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- import type { FinalizedElement } from '@e-mc/types/lib/squared';
2
-
3
1
  import type { DocumentConstructor, IDocument, IFileManager } from '@e-mc/types/lib';
4
2
  import type { ExternalAsset } from '@e-mc/types/lib/asset';
5
3
  import type { ExecAction, DocumentDirectory as IDocumentDirectory, DocumentModule as IDocumentModule, DocumentSettings as IDocumentSettings } from '@e-mc/types/lib/settings';
6
4
 
7
- import type { DependencyScopes, DocumentOutput } from './squared';
5
+ import type { DependencyScopes, DocumentOutput, FinalizedElement } from './squared';
8
6
 
9
7
  interface DocumentDirectory extends IDocumentDirectory {
10
8
  template?: string;
9
+ project?: string;
11
10
  }
12
11
 
13
12
  interface AndroidDocumentSettings extends Pick<IDocumentSettings, "users" | "directory">, PlainObject {
@@ -18,11 +17,10 @@ interface AndroidDocumentSettings extends Pick<IDocumentSettings, "users" | "dir
18
17
  };
19
18
  };
20
19
  language?: {
21
- gradle?: "java" | "kotlin" | "java+kotlin";
20
+ [T in LanguageOfType]?: LanguageType;
22
21
  };
23
22
  }
24
23
 
25
- type LanguageType = "gradle";
26
24
  type DocumentProperties = "targetAPI" | "elements" | "extensionData" | "directories";
27
25
 
28
26
  export interface UserConfig extends Omit<DocumentOutput, DocumentProperties> {
@@ -42,13 +40,14 @@ export interface TemplateData {
42
40
  source?: string;
43
41
  existing?: boolean;
44
42
  kotlin?: boolean;
45
- language?: string;
43
+ language?: LanguageType;
46
44
  }
47
45
 
48
46
  export interface FindTemplateOptions {
49
47
  detect?: boolean;
50
- languageOf?: LanguageType;
48
+ languageOf?: LanguageOfType;
51
49
  subDir?: ArrayOf<string>;
50
+ throwsDoesNotExist?: boolean;
52
51
  }
53
52
 
54
53
  export interface MavenArtifact {
@@ -59,19 +58,23 @@ export interface MavenArtifact {
59
58
  dependencies?: MavenArtifact[];
60
59
  }
61
60
 
62
- export interface IAndroidDocument<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends IDocument<T, U>, Pick<DocumentOutput, DocumentProperties> {
61
+ export type LanguageType = "java" | "kotlin" | "java+kotlin";
62
+ export type LanguageOfType = "gradle";
63
+ export type DocumentAsset = ExternalAsset;
64
+
65
+ export interface IAndroidDocument<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends IDocument<T, U, DocumentModule>, Pick<DocumentOutput, DocumentProperties> {
63
66
  config: UserConfig;
64
67
  elements: FinalizedElement[];
65
68
  extensionData: PlainObject;
66
69
  findTemplate(baseDir: string, filename: string, options?: FindTemplateOptions): TemplateData;
67
70
  findData<V = AnyObject>(filename: string, format?: string): Null<V>;
71
+ languageOf(name: LanguageOfType, value?: LanguageType): Undef<LanguageType>;
68
72
  detectKts(...paths: string[]): Null<boolean>;
73
+ detect(host?: T): boolean;
69
74
  get settings(): AndroidDocumentSettings;
70
75
  }
71
76
 
72
- export interface AndroidDocumentConstructor<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends DocumentConstructor<T, U> {
77
+ export interface AndroidDocumentConstructor<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends ConstructorDerived<DocumentConstructor<T, U>> {
73
78
  readonly prototype: IAndroidDocument<T, U>;
74
79
  new(module?: DocumentModule, ...args: unknown[]): IAndroidDocument<T, U>;
75
- }
76
-
77
- export type DocumentAsset = ExternalAsset;
80
+ }
@@ -1,7 +1,33 @@
1
- import type { FinalizedElement, ControllerSettingsDirectoryUI as IControllerSettingsDirectoryUI } from '@e-mc/types/lib/squared';
2
-
3
1
  import type { RequestData as IRequestData } from '@e-mc/types/lib/node';
4
2
 
3
+ interface BoxRect<T = number> {
4
+ top: T;
5
+ right: T;
6
+ bottom: T;
7
+ left: T;
8
+ }
9
+
10
+ interface BoxRectDimension extends BoxRect, Dimension {
11
+ numberOfLines?: number;
12
+ overflow?: boolean;
13
+ }
14
+
15
+ export interface FinalizedElement {
16
+ documentId: string;
17
+ bounds: BoxRectDimension;
18
+ css: PlainObject;
19
+ outerWrapperIds?: string[];
20
+ }
21
+
22
+ export interface ConditionProperty {
23
+ conditionText: string;
24
+ }
25
+
26
+ export interface CssConditionData extends ConditionProperty {
27
+ name?: string;
28
+ conditionText: string;
29
+ }
30
+
5
31
  export interface DocumentOutput {
6
32
  targetAPI?: number | string;
7
33
  manifest?: ManifestData;
@@ -9,7 +35,7 @@ export interface DocumentOutput {
9
35
  applicationId?: string;
10
36
  profileable?: boolean | ArrayOf<string>;
11
37
  dependencies?: string[];
12
- dependencyScopes?: boolean | 1 | ArrayOf<DependencyScopes | "snapshot">;
38
+ dependencyScopes?: boolean | 1 | ArrayOf<DependencyScopes | "snapshot" | "constraints">;
13
39
  directories?: ControllerSettingsDirectoryUI;
14
40
  elements?: FinalizedElement[];
15
41
  projectName?: string;
@@ -17,6 +43,8 @@ export interface DocumentOutput {
17
43
  mainSrcDir?: string;
18
44
  mainActivityFile?: string;
19
45
  javaVersion?: number | string;
46
+ jvmToolchain?: number | string;
47
+ versionCatalog?: boolean;
20
48
  versionName?: string;
21
49
  versionCode?: number;
22
50
  dataBinding?: boolean;
@@ -47,7 +75,13 @@ export interface ManifestData extends PlainObject {
47
75
  };
48
76
  }
49
77
 
50
- export interface ControllerSettingsDirectoryUI extends IControllerSettingsDirectoryUI {
78
+ export interface ControllerSettingsDirectoryUI {
79
+ layout: string;
80
+ string: string;
81
+ font: string;
82
+ image: string;
83
+ video: string;
84
+ audio: string;
51
85
  main: string;
52
86
  animation: string;
53
87
  theme: string;