Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
fix(cwrapsignature): supply typed returntype
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jul 10, 2018
1 parent 649b1d4 commit df4916b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/SassAsmModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
type stringToUTF8Signature = (str: string, outPtr: number, maxBytesToWrite: number) => void;

/** @internal */
type cwrapSignature = <T = Function>(fn: string, returnType: string | null, parameterType: Array<string>) => T;
type cwrapSignature = <T = Function>(
fn: string,
returnType: 'number' | 'string' | 'array' | null,
parameterType?: Array<string>
) => T;

/** @internal */
type FILESYSTEMS = {
Expand Down
2 changes: 1 addition & 1 deletion src/interop/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { cwrapSignature, SassAsmModule } from '../SassAsmModule';
*/
const wrapContextInterface = (cwrap: cwrapSignature) => ({
//struct Sass_Options* sass_make_options (void);
make_options: cwrap<() => number>(`sass_make_options`, 'number', []),
make_options: cwrap<() => number>(`sass_make_options`, 'number'),

//struct Sass_File_Context* sass_make_file_context (const char* input_path);
make_file_context: null,
Expand Down

0 comments on commit df4916b

Please sign in to comment.