mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
22 lines
684 B
TypeScript
22 lines
684 B
TypeScript
import { createContext } from 'react';
|
|
|
|
export interface GitCredential {
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
export interface GitSettings {
|
|
credentials: Record<string, GitCredential>; // keyed by origin
|
|
corsProxy: string;
|
|
}
|
|
|
|
export interface GitSettingsContextType {
|
|
settings: GitSettings;
|
|
updateSettings: (settings: Partial<GitSettings>) => void;
|
|
addCredential: (origin: string, credential: GitCredential) => void;
|
|
removeCredential: (origin: string) => void;
|
|
updateCredential: (origin: string, credential: Partial<GitCredential>) => void;
|
|
isConfigured: boolean;
|
|
}
|
|
|
|
export const GitSettingsContext = createContext<GitSettingsContextType | undefined>(undefined); |