woodpecker/web/src/compositions/useConfig.ts

24 lines
763 B
TypeScript
Raw Normal View History

import { User } from '~/lib/api/types';
declare global {
interface Window {
WOODPECKER_USER: User | undefined;
WOODPECKER_DOCS: string | undefined;
WOODPECKER_VERSION: string | undefined;
WOODPECKER_CSRF: string | undefined;
2023-08-08 10:22:39 +00:00
WOODPECKER_FORGE: 'github' | 'gitlab' | 'gitea' | 'bitbucket' | undefined;
WOODPECKER_ROOT_PATH: string | undefined;
WOODPECKER_ENABLE_SWAGGER: boolean | undefined;
}
}
export default () => ({
user: window.WOODPECKER_USER || null,
docs: window.WOODPECKER_DOCS || null,
version: window.WOODPECKER_VERSION,
csrf: window.WOODPECKER_CSRF || null,
2022-06-17 18:14:01 +00:00
forge: window.WOODPECKER_FORGE || null,
rootPath: window.WOODPECKER_ROOT_PATH || '',
enableSwagger: window.WOODPECKER_ENABLE_SWAGGER || false,
});