import(methods)
importFrom(stats, setNames)
importFrom(tools, file_path_as_absolute)

import(BiocGenerics)
import(S4Vectors)
import(IRanges)
import(S4Arrays)
import(SparseArray)
import(DelayedArray)
importFrom(Rarr, read_zarr_array, create_empty_zarr_array, update_zarr_array,
                 read_zarr_attributes)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 classes
###

exportClasses(
    ZarrArraySeed,
    ZarrArray, ZarrMatrix,
    ZarrRealizationSink,
    ZarrSparseMatrixSeed, CSC_ZarrSparseMatrixSeed, CSR_ZarrSparseMatrixSeed,
    ZarrSparseMatrix
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S3 methods
###

S3method(t, CSC_ZarrSparseMatrixSeed)
S3method(t, CSR_ZarrSparseMatrixSeed)

### We also export them thru the export() directive so that (a) they can be
### called directly, (b) tab-completion on the name of the generic shows them,
### and (c) methods() doesn't asterisk them.

export(
    t.CSC_ZarrSparseMatrixSeed,
    t.CSR_ZarrSparseMatrixSeed
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 methods for generics not defined in ZarrArray
###

exportMethods(
    ## Methods for generics defined in the base package:
    dim, t,

    ## Methods for generics defined in the methods package:
    show, coerce,

    ## Methods for generics defined in the BiocGenerics package:
    path, type,

    ## Methods for generics defined in the S4Arrays package:
    extract_array, write_block, is_sparse,

    ## Methods for generics defined in the SparseArray package:
    nzcount, extract_sparse_array,

    ## Methods for generics defined in the DelayedArray package:
    chunkdim,
    matrixClass, DelayedArray
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export non-generic functions
###

export(
    ## ZarrArraySeed-class.R:
    ZarrArraySeed,

    ## ZarrArray-class.R:
    ZarrArray,

    ## writeZarrArray-auto-args.R:
    get_writeZarrArray_dump_dir, set_writeZarrArray_dump_dir,
    get_writeZarrArray_auto_path,
    get_writeZarrArray_chunk_maxlen, set_writeZarrArray_chunk_maxlen,
    get_writeZarrArray_chunk_shape, set_writeZarrArray_chunk_shape,
    get_writeZarrArray_auto_chunkdim,

    ## writeZarrArray.R:
    ZarrRealizationSink, writeZarrArray,

    ## ZarrSparseMatrixSeed-class.R:
    ZarrSparseMatrixSeed,

    ## ZarrSparseMatrix-class.R:
    ZarrSparseMatrix
)

