importFrom("methods","slot","slot<-","new","is","slotNames","selectMethod",
             "setClass","representation","prototype","setMethod",
             "signature","setGeneric")
importFrom("grDevices", "dev.cur", "dev.interactive", "dev.new",
             "dev.off", "dev.print", "gray", "heat.colors", "n2mfrow",
             "pdf", "postscript", "xy.coords")
importFrom("graphics", "abline", "axTicks", "axis", "hist", "image",
             "legend", "lines", "matlines", "matplot", "mtext", "par",
             "plot", "plot.new", "plot.window", "points", "rect",
             "segments", "title", "xinch", "yinch")
importFrom("stats", "IQR", "approxfun", "coef", "deviance", "dnorm",
             "formula", "na.omit", "naprint", "nls", "nls.control",
             "numericDeriv", "optim", "predict", "printCoefmat", "pt",
             "quantile", "rnorm", "symnum")
importFrom("utils", "capture.output", "read.table", "tail",
             "write.table")             
importFrom("fields","image.plot","tim.colors","two.colors")
importFrom("nnls","nnls","nnnpls")
importFrom("deSolve","lsoda")
importFrom("gplots","plotCI")
importFrom("colorspace","sequential_hcl","diverge_hcl")
importFrom("splines","ns","bs","interpSpline")
importFrom("minpack.lm","nls.lm")
importFrom("gclus","plotcolors")

# import("maps") # only needed when used in "Depends" in DESCRIPTION
# import("spam") # likewise

exportClasses(dat, kin, spec, mass, amp,
              theta, multimodel, res, multitheta, kinopt,
              specopt, massopt, opt, fit)

exportMethods(getClpindepX, residPart, plotter)

export(readData, preProcess, baseIRF, initModel, 
       fitModel, examineFit, sumKinSpecEst)

export(dat, kin, spec, mass, amp, theta, multimodel, res, multitheta,
       kinopt, specopt, massopt, opt, fit, addDscal, getDiffThetaChange,
       plotFLIM, addPrelCl, getDiffThetaClChange, plotKinBreakDown, addPrel,
       getDiffThetaCl, plotClp, getDiffTheta, baseCorlambda, getFixed,
       baseCortime, applyWeightingModel, scaleConList, getGroups,
       getModel, plotter, calcB, getPar, calcCirf, convGausExp,
       getPrel, plotTracesSuper, calcC, displayEst, getPrelTheta, calcEbspline,
       calcEhiergaus, getSpecList, rescomp, compCoh, compOsc, residPart, compModel,
       getSpecToPlot, getThetaCl, sample_sel, getTheta, diffAdd, diffChange,
       diffFree, diffRel, diffRemove, initModellist, doClpConstr,
       simndecay_gen, doSVD, simpExp, simpPol, skew, specModel, irfparF,
       specparF, fillK, l2nu, linloglines, fullKF, linlogplot, gaus,
       getClpConstr, weightNL, matlinlogplot, weightPsi, getCoh, getOsc,
       writeEst, getCohToPlot, normdat, writeFit, getConToPlot,
       plotKinSpecEst, fillResult, getResid, getResidRet,
       processOrder, multiLin, readclp0, compModelMass, barplot3,
       getXsuper, doConstrSuper, getKinConcen, getAutoClp0,
       outlierCorr, linlogtics, unitstep, modifyModel, parEst, onls,
       sumnls, getCLPList, getData, getSVDResiduals, getSVDData,
       getTraces, getdim1, getdim2, getX, getC, getCLP, getDAS, getResiduals, getXList,
       getSelectedTracesMax, writeAverage, efit2file, divergeZimage,
       plotHistAmp, plotHistNormComp, plotIntenImage, plotTau,
       plotNormComp, plotSelIntenImage, calcD)

S3method("summary", "timp.nls.lm")
S3method("summary", "timp.nls")
S3method("summary", "timp.optim")
S3method("print", "summary.timp.nls.lm")
S3method("print", "summary.timp.nls")
S3method("print", "summary.timp.optim")
S3method("print", "timp.nls.lm")
S3method("print", "timp.nls")
S3method("print", "timp.optim")

# TODO: Read up on Writing Portable Packages
# Ref https://stackoverflow.com/questions/42313373/r-cmd-check-note-found-no-calls-to-r-registerroutines-r-usedynamicsymbols
useDynLib("TIMP", .registration = TRUE)
