Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HolbyFPV committed Nov 20, 2024
1 parent ed96141 commit aee5a45
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 247 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/boilerplate-solid-ts/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>Zebar</title>
<script type="module" crossorigin src="./assets/index-B2wwdUq_.js"></script>
<script type="module" crossorigin src="./assets/index-CsvkC0F_.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DhTpoJOY.css">
</head>
<body>
Expand Down
6 changes: 2 additions & 4 deletions packages/client-api/src/providers/create-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import type {
DateProviderConfig,
DateProvider,
} from './date/date-provider-types';
import {
createFocusedWindowProvider
} from './focused-window/create-focused-window-provider';
import { createFocusedWindowProvider } from './focused-window/create-focused-window-provider';
import type {
FocusedWindowProviderConfig,
FocusedWindowProvider,
Expand Down Expand Up @@ -139,7 +137,7 @@ export function createProvider<T extends ProviderConfig>(
case 'date':
return createDateProvider(config) as any;
case 'focusedWindow':
return createFocusedWindowProvider(config) as any;
return createFocusedWindowProvider(config) as any;
case 'glazewm':
return createGlazeWmProvider(config) as any;
case 'host':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ import { z } from 'zod';
import { createBaseProvider } from '../create-base-provider';
import { onProviderEmit } from '~/desktop';
import type {
FocusedWindowOutput,
FocusedWindowProvider,
FocusedWindowProviderConfig,
FocusedWindowOutput,
FocusedWindowProvider,
FocusedWindowProviderConfig,
} from './focused-window-provider-types';

const focusedWindowProviderConfigSchema = z.object({
type: z.literal('focusedWindow'),
type: z.literal('focusedWindow'),
});

export function createFocusedWindowProvider(
config: FocusedWindowProviderConfig,
config: FocusedWindowProviderConfig,
): FocusedWindowProvider {
const mergedConfig = focusedWindowProviderConfigSchema.parse(config);
const mergedConfig = focusedWindowProviderConfigSchema.parse(config);

return createBaseProvider(mergedConfig, async queue => {
return onProviderEmit<FocusedWindowOutput>(mergedConfig, ({ result }) => {
if ('error' in result) {
queue.error(result.error);
} else {
queue.output(result.output);
}
});
return createBaseProvider(mergedConfig, async queue => {
return onProviderEmit<FocusedWindowOutput>(
mergedConfig,
({ result }) => {
if ('error' in result) {
queue.error(result.error);
} else {
queue.output(result.output);
}
},
);
});
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import type { Provider } from '../create-base-provider';

export interface FocusedWindowProviderConfig {
type: 'focusedWindow';
type: 'focusedWindow';
}

export interface FocusedWindowOutput {
title: string;
icon: string;
title: string;
icon: string;
}

export type FocusedWindowProvider = Provider<FocusedWindowProviderConfig, FocusedWindowOutput>;
export type FocusedWindowProvider = Provider<
FocusedWindowProviderConfig,
FocusedWindowOutput
>;
Binary file removed packages/desktop/icon.png
Binary file not shown.
223 changes: 0 additions & 223 deletions packages/desktop/src/providers/provider_ref.rs

This file was deleted.

0 comments on commit aee5a45

Please sign in to comment.