@cparra/apex-reflection 2.18.0 → 2.19.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export declare function reflect(declarationBody: string): ReflectionResult;
2
2
  export declare function reflectAsync(declarationBody: string): Promise<ReflectionResult>;
3
+ export declare function reflectTrigger(declarationBody: string): TriggerReflectionResult;
4
+ export declare function reflectTriggerAsync(declarationBody: string): Promise<TriggerReflectionResult>;
3
5
  export interface ParamAnnotation {
4
6
  bodyLines: string[];
5
7
  paramName: string;
@@ -111,11 +113,21 @@ export interface ReflectionResult {
111
113
  typeMirror?: Type;
112
114
  error?: ParsingError;
113
115
  }
116
+ export interface TriggerReflectionResult {
117
+ triggerMirror?: TriggerMirror;
118
+ error?: ParsingError;
119
+ }
114
120
  export interface ParsingError {
115
121
  message: string;
116
122
  }
117
123
  type TypeName = "class" | "interface" | "enum";
118
124
  export type Type = InterfaceMirror | ClassMirror | EnumMirror;
125
+ export interface TriggerMirror {
126
+ docComment?: DocComment;
127
+ name: string;
128
+ object_name: string;
129
+ events: string[];
130
+ }
119
131
  export interface EnumMirror {
120
132
  annotations: Annotation[];
121
133
  name: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reflectAsync = exports.reflect = void 0;
3
+ exports.reflectTriggerAsync = exports.reflectTrigger = exports.reflectAsync = exports.reflect = void 0;
4
4
  require("./out.js");
5
5
  function reflect(declarationBody) {
6
6
  // @ts-expect-error "reflect" is added to self by the "out" module
@@ -13,3 +13,13 @@ async function reflectAsync(declarationBody) {
13
13
  return JSON.parse(result);
14
14
  }
15
15
  exports.reflectAsync = reflectAsync;
16
+ function reflectTrigger(declarationBody) {
17
+ // @ts-expect-error "reflectTrigger" is added to self by the "out" module
18
+ return JSON.parse(self.reflectTrigger(declarationBody));
19
+ }
20
+ exports.reflectTrigger = reflectTrigger;
21
+ function reflectTriggerAsync(declarationBody) {
22
+ // @ts-expect-error "reflectTriggerAsync" is added to self by the "out" module
23
+ return self.reflectTriggerAsync(declarationBody).then((result) => JSON.parse(result));
24
+ }
25
+ exports.reflectTriggerAsync = reflectTriggerAsync;