-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(io): expose itk-wasm setPipelineBaseUrl setPipelineWorkerUrl
- Loading branch information
Showing
6 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@itk-viewer/blosc-zarr': minor | ||
'@itk-viewer/io': minor | ||
--- | ||
|
||
Export itk-wasm pipeline url setting functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
|
||
export function bloscZarrDecompress(chunkData: Array<{data: ArrayBuffer, metadata: any}>): Promise<Array<ArrayBuffer>>; | ||
export function bloscZarrDecompress(chunkData: Array<{data: ArrayBuffer, metadata: any}>): Promise<Array<ArrayBuffer>>; | ||
|
||
export function getPipelinesBaseUrl(): string; | ||
export function setPipelinesBaseUrl(url: string): void; | ||
export function getPipelineWorkerUrl(): string; | ||
export function setPipelineWorkerUrl(url: string): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { getPipelinesBaseUrl as itkWasmGetPipelinesBaseUrl, getPipelineWorkerUrl as itkWasmGetPipelineWorkerUrl } from "itk-wasm"; | ||
import { version } from "./version.js"; | ||
|
||
let pipelinesBaseUrl | ||
let defaultPipelinesBaseUrl = | ||
`https://cdn.jsdelivr.net/npm/@itk-viewer/blosc-zarr@${version}/`; | ||
|
||
export function setPipelinesBaseUrl(baseUrl) { | ||
pipelinesBaseUrl = baseUrl; | ||
} | ||
|
||
export function getPipelinesBaseUrl() { | ||
if (typeof pipelinesBaseUrl !== "undefined") { | ||
return pipelinesBaseUrl; | ||
} | ||
const itkWasmPipelinesBaseUrl = itkWasmGetPipelinesBaseUrl(); | ||
if (typeof itkWasmPipelinesBaseUrl !== "undefined") { | ||
return itkWasmPipelinesBaseUrl; | ||
} | ||
return defaultPipelinesBaseUrl; | ||
} | ||
|
||
let pipelineWorkerUrl | ||
// Use the version shipped with an app's bundler | ||
const defaultPipelineWorkerUrl = null | ||
|
||
export function setPipelineWorkerUrl (workerUrl) { | ||
pipelineWorkerUrl = workerUrl | ||
} | ||
|
||
export function getPipelineWorkerUrl () { | ||
if (typeof pipelineWorkerUrl !== 'undefined') { | ||
return pipelineWorkerUrl | ||
} | ||
const itkWasmPipelineWorkerUrl = itkWasmGetPipelineWorkerUrl() | ||
if (typeof itkWasmPipelineWorkerUrl !== 'undefined') { | ||
return itkWasmPipelineWorkerUrl | ||
} | ||
return defaultPipelineWorkerUrl | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const version = "0.1.3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export { | ||
getPipelinesBaseUrl, | ||
setPipelinesBaseUrl, | ||
getPipelineWorkerUrl, | ||
setPipelineWorkerUrl, | ||
} from 'itk-wasm'; | ||
|
||
export { | ||
getPipelinesBaseUrl as bloscZarrGetPipelinesBaseUrl, | ||
setPipelinesBaseUrl as bloscZarrSetPipelinesBaseUrl, | ||
getPipelineWorkerUrl as bloscZarrGetPipelineWorkerUrl, | ||
setPipelineWorkerUrl as bloscZarrSetPipelineWorkerUrl, | ||
} from '@itk-viewer/blosc-zarr/bloscZarrDecompress.js'; |