hunk.code_window:   /ExtensionLoadWarning/,
   ];
   // these are set before calling `config`, so we have a chance to override them
   try {
     const devJson = readFileSync(
       path.resolve(electronDir, './dev.json'),
       'utf-8'
     );
     const devEnv = JSON.parse(devJson);
     Object.assign(process.env, devEnv);
   } catch (err) {
     console.warn(
       `Could not read dev.json. Some functions may not work as expected.`
     );
   }
   /** @type {ChildProcessWithoutNullStreams | null} */
   let spawnProcess = null;
   function spawnOrReloadElectron() {
  
hunk.labels: keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
hunk.file_path: apps/electron/scripts/dev.mjs
hunk.type: replace
file: import type {
    Literal,
    LiteralValue,
    PropertiesMeta,
    VariableMap,
  } from '@affine/env/filter';
  import {
    CreatedIcon,
    FavoriteIcon,
    TagsIcon,
    UpdatedIcon,
  } from '@blocksuite/icons';
  import type { ReactElement } from 'react';
  
  import { tBoolean, tDate, tTag } from './logical/custom-type';
  import type { TType } from './logical/typesystem';
  import { tArray } from './logical/typesystem';
  
  export const toLiteral = (value: LiteralValue): Literal => ({
    type: 'literal',
    value,
  });
  
  export type FilterVariable = {
    name: keyof VariableMap;
    type: (propertiesMeta: PropertiesMeta) => TType;
    icon: ReactElement;
  };
  
  export const variableDefineMap = {
    Created: {
      type: () => tDate.create(),
      icon: <CreatedIcon />,
    },
    Updated: {
      type: () => tDate.create(),
      icon: <UpdatedIcon />,
    },
    'Is Favourited': {
      type: () => tBoolean.create(),
      icon: <FavoriteIcon />,
    },
    Tags: {
      type: meta => tArray(tTag.create({ tags: meta.tags.options })),
      icon: <TagsIcon />,
    },
    // Imported: {
    //   type: tBoolean.create(),
    // },
    // 'Daily Note': {
    //   type: tBoolean.create(),
    // },
  } satisfies Record<string, Omit<FilterVariable, 'name'>>;
  
  export type InternalVariableMap = {
    [K in keyof typeof variableDefineMap]: LiteralValue;
  };
  
  declare module '@affine/env/filter' {
    // eslint-disable-next-line @typescript-eslint/no-empty-interface
    interface VariableMap extends InternalVariableMap {}
  }
  