Skip to content

Commit

Permalink
add types
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Oct 25, 2023
1 parent 8d56345 commit eedd3c4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/actions/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ import { convertPreset } from '@visbot/webvsc';
import { basename } from "node:path";
import { readFile, stat } from 'node:fs/promises';

export const defaultOptions = {
type Options = {
indent: number,
debug: boolean,
summary: boolean,
watch: boolean
}

export const defaultOptions: Options = {
indent: 2,
debug: false,
summary: false,
watch: false
}

export async function convertFile(avsFile: string, options = defaultOptions) {
export async function convertFile(avsFile: string, options: Options = defaultOptions) {
const presetName = basename(avsFile, '.avs');
const avsBuffer = await readFile(avsFile);
const modifiedDate = ((await stat(avsFile)).mtime || new Date()).toISOString();
Expand Down

0 comments on commit eedd3c4

Please sign in to comment.