Skip to content

Commit d56481f

Browse files
authored
chore: export types actor memory expression (#575)
This PR just exports types from `actor-memory-expression` package, so that they can be used as well
1 parent 5ae454f commit d56481f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './memory_calculator';
2+
export * from './types';

packages/actor-memory-expression/src/memory_calculator.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
compileDependencies,
66
create,
77
divideDependencies,
8-
type EvalFunction,
98
evaluateDependencies,
109
maxDependencies,
1110
minDependencies,
@@ -20,7 +19,7 @@ import {
2019

2120
import { ACTOR_LIMITS } from '@apify/consts';
2221

23-
import type { ActorRunOptions, CompilationCache, MemoryEvaluationContext } from './types.js';
22+
import type { ActorRunOptions, CompilationCache, CompilationResult, MemoryEvaluationContext } from './types.js';
2423

2524
// In theory, users could create expressions longer than 1000 characters,
2625
// but in practice, it's unlikely anyone would need that much complexity.
@@ -176,9 +175,9 @@ const processTemplateVariables = (defaultMemoryMbytes: string): string => {
176175
*
177176
* @param expression The expression string to compile.
178177
* @param cache An optional cache to store/retrieve compiled expressions.
179-
* @returns The compiled EvalFunction.
178+
* @returns The compiled CompilationResult.
180179
*/
181-
const getCompiledExpression = async (expression: string, cache: CompilationCache | undefined): Promise<EvalFunction> => {
180+
const getCompiledExpression = async (expression: string, cache: CompilationCache | undefined): Promise<CompilationResult> => {
182181
if (!cache) {
183182
return compile(expression);
184183
}

packages/actor-memory-expression/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ export type CompilationCache = {
2020
set: (expression: string, compilationResult: EvalFunction) => Promise<void>;
2121
size: () => Promise<number>;
2222
}
23+
24+
export type CompilationResult = EvalFunction;

0 commit comments

Comments
 (0)