@sketch-hq/sketch-assistant-types
Advanced tools
Comparing version 5.0.0-next.15 to 5.0.0-next.16
# @sketch-hq/sketch-assistant-types | ||
## 5.0.0-next.16 | ||
### Minor Changes | ||
- 8351103: Add rule timings to profile data. | ||
## 5.0.0-next.15 | ||
@@ -4,0 +10,0 @@ |
@@ -116,2 +116,15 @@ import { FileFormat3 } from '@sketch-hq/sketch-file-format-ts'; | ||
file: SketchFile; | ||
/** | ||
* Statistics about the processed file. | ||
*/ | ||
profile: { | ||
/** | ||
* Number of Sketch objetcs in the file. | ||
*/ | ||
numObjects: number; | ||
/** | ||
* Time taken for processing in milliseconds. | ||
*/ | ||
time: number; | ||
}; | ||
}; | ||
@@ -166,11 +179,54 @@ /** | ||
export declare type RunOutput = { | ||
[assistantName: string]: { | ||
code: 'error'; | ||
result: AssistantErrorResult; | ||
} | { | ||
code: 'success'; | ||
result: AssistantSuccessResult; | ||
/** | ||
* Mirror input in the output, for easier processing of results. | ||
*/ | ||
input: RunInput; | ||
/** | ||
* Results per Assistant. | ||
* "error": The Assistant run failed entirely. | ||
* "success": One or more rules ran successfully. | ||
*/ | ||
assistants: { | ||
[assistantName: string]: { | ||
code: 'error'; | ||
result: AssistantErrorResult; | ||
} | { | ||
code: 'success'; | ||
result: AssistantSuccessResult; | ||
}; | ||
}; | ||
}; | ||
/** | ||
* Profiling statistics about a run. | ||
*/ | ||
export declare type RunProfile = { | ||
[file: string]: { | ||
file: { | ||
processingTimeMS: number; | ||
numObjects: number; | ||
complexityObjPerMB: number; | ||
sizeMB: number; | ||
objects: { | ||
[key in keyof ObjectCache]?: { | ||
count: number; | ||
}; | ||
}; | ||
}; | ||
assistants: { | ||
[assistantName: string]: { | ||
runTimeMS: number; | ||
violations: number; | ||
ruleErrors: number; | ||
rules: { | ||
[ruleName: string]: { | ||
violations: number; | ||
runTimeMS: number; | ||
impactMSPerViolation: number; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
/** | ||
* The run has failed to the extent that collating a RunOutput object is not | ||
@@ -241,2 +297,10 @@ * possible, and the runner function promise rejects instead. | ||
}; | ||
/** | ||
* Object containing information about how long each rule took to execute. | ||
*/ | ||
profile: { | ||
ruleTimings: { | ||
[ruleName: string]: number; | ||
}; | ||
}; | ||
}; | ||
@@ -243,0 +307,0 @@ /** |
{ | ||
"name": "@sketch-hq/sketch-assistant-types", | ||
"version": "5.0.0-next.15", | ||
"version": "5.0.0-next.16", | ||
"main": "dist/types", | ||
@@ -5,0 +5,0 @@ "types": "dist/types", |
Sorry, the diff of this file is not supported yet
39116
776