@akanjs/language 3.2.0-rc.2 → 3.2.0-rc.20

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.
@@ -0,0 +1,18 @@
1
+ import type { AkanGraphEdgeKind, AkanGraphLocation, AkanGraphNode, AkanGraphNodeKind } from "akanjs/common/akanGraph.ts";
2
+ import type { AkanGraphSource } from "./akanGraph";
3
+ import { type GuardResolver } from "./guardResolver";
4
+ import type { AkanSpan, Extent, FileFacts, ServiceClassFact } from "./moduleFacts";
5
+ export interface GraphSink {
6
+ key: (kind: AkanGraphNodeKind, owner: string | null, scope: string) => string;
7
+ addNode: (id: string, kind: AkanGraphNodeKind, owner: string | null, name: string, span: AkanSpan | null, detail: string[]) => AkanGraphNode;
8
+ addEdge: (from: string, to: string, kind: AkanGraphEdgeKind, label: string | null, at: AkanGraphLocation | null) => void;
9
+ digest: (node: AkanGraphNode, text: string | undefined, extent: Extent) => void;
10
+ location: (span: AkanSpan) => AkanGraphLocation;
11
+ }
12
+ export declare class AdaptorResolver {
13
+ #private;
14
+ constructor(source: AkanGraphSource, resolver: GuardResolver, sink: GraphSink);
15
+ declare(facts: FileFacts[]): void;
16
+ addService(refName: string, service: ServiceClassFact, file: FileFacts): void;
17
+ pluggedOf(owner: string | null, module: string | null, field: string): string[];
18
+ }
package/guardFacts.d.ts CHANGED
@@ -5,18 +5,25 @@ export interface GuardFact extends MemberFact {
5
5
  scope: string | null;
6
6
  doc: string | null;
7
7
  factory: string | null;
8
+ layers: number;
9
+ }
10
+ export interface GuardVia {
11
+ callee: string;
12
+ layers: number;
8
13
  }
9
14
  export interface GuardFactoryFact extends MemberFact {
10
15
  scope: string | null;
11
16
  doc: string | null;
12
17
  direct: boolean;
13
- via: string[];
18
+ via: GuardVia[];
19
+ layers: number;
14
20
  }
15
21
  export interface GuardCallFact extends MemberFact {
16
22
  callee: string;
17
23
  kind: "call" | "extends";
18
24
  scope: string | null;
19
25
  doc: string | null;
26
+ layers: number;
20
27
  }
21
28
  export interface InPlaceGuard {
22
29
  call: TS.CallExpression;
@@ -25,6 +25,23 @@ type GuardLookup = {
25
25
  } | {
26
26
  external: true;
27
27
  };
28
+ interface Reexport {
29
+ name: string;
30
+ from: string | null;
31
+ }
32
+ interface StarExports {
33
+ owners: string[];
34
+ packages: string[];
35
+ paths: string[];
36
+ isOpaque: boolean;
37
+ }
38
+ interface ModuleExports {
39
+ named: (Reexport & {
40
+ fileName: string;
41
+ }) | null;
42
+ stars: string[];
43
+ isLocal: boolean;
44
+ }
28
45
  interface Declaration {
29
46
  source: TS.SourceFile;
30
47
  statement: TS.Statement;
@@ -33,19 +50,19 @@ interface Declaration {
33
50
  name: string;
34
51
  }
35
52
  export declare const frameworkOwner = "akanjs";
53
+ export declare const frameworkPattern: RegExp;
36
54
  export declare class GuardResolver {
37
55
  #private;
38
56
  constructor(source: AkanGraphSource, routes: RouteFactReader);
39
57
  find(local: string, site: GuardSite): GuardLookup;
40
58
  madeInPlace(fileName: string, name: string): DeclaredGuard | undefined;
41
59
  declare(facts: FileFacts[]): DeclaredGuard[];
42
- reexportOf(owner: string, name: string, near: string | null): {
43
- local: string;
44
- site: GuardSite;
45
- } | null;
46
60
  declarationOf(owner: string, name: string, near: string | null, depth?: number): Declaration | null;
61
+ starExportsOf(owner: string, near: string): StarExports;
62
+ exportsAt(path: string, name: string): ModuleExports;
63
+ mentionsAlong(path: string, name: string): boolean;
47
64
  declares(owner: string, name: string): boolean;
48
- filesIn(owner: string): [fileName: string, words: string][];
65
+ declaresAt(path: string, name: string): boolean;
49
66
  inOwner(fileName: string, owner: string | null): string;
50
67
  ownerOfSpecifier(fileName: string, specifier: string): string | undefined;
51
68
  pathOfSpecifier(fileName: string, specifier: string): string | null;