Implement api for extension point typings (#1638)

Currently, the only way to explore available extension points is through our documentation or by browsing the source code. Once you find them, there is no guard rails and the usage is prone to user errors. This new api allows the declaration of extension points as types in code. This way, exposing an extension point is as easy as exporting it from a module. Both the implementation and the developer who uses the extension point work with the same shared type that allows auto-completion and type-checks for safety. This feature is backwards-compatible as the generic methods all have sensible defaults for the type parameters.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
Konstantin Schaper
2021-05-12 16:05:30 +02:00
committed by GitHub
parent b6b304f338
commit 7286a62a80
18 changed files with 5335 additions and 7317 deletions

View File

@@ -284,7 +284,7 @@ const EXPORT_MEDIA_TYPE = "application/vnd.scmm-repositoryExport+json;v=2";
export const useExportRepository = () => {
const queryClient = useQueryClient();
const [intervalId, setIntervalId] = useState<number | undefined>();
const [intervalId, setIntervalId] = useState<ReturnType<typeof setTimeout>>();
useEffect(() => {
return () => {
if (intervalId) {