useDynLib(fixest, .registration = TRUE)

#
# EXPORT
#

# main funs
export(feNmlm, femlm, feols, feglm, fepois, fenegbin)
export(feglm.fit)
# misc funs
export(etable, esttex, esttable, collinearity, obs2remove, r2)
# did
export(did_means)
# graph
export(coefplot)
# small funs
export(coeftable, ctable, se, tstat, pvalue)
# dof
export(dof)
# Lag related
export(panel, unpanel, f, l)
# interactions
export(i, interact)
# macro
export(xpd)
# utilities
export(to_integer, demean)
# setters & getters
exportPattern("^(s|g)etFixest")

# deprecated
export(did_estimate_yearly_effects, did_plot_yearly_effects, errbar)

# Base methods
S3method(print, fixest)
S3method(summary, fixest.fixef)
S3method(summary, fixest.obs2remove)
S3method(summary, fixest)
export(summ) # alias for summary.fixest
S3method(plot, fixest.fixef)
S3method("[", fixest_panel) # Lag related

# Stats methods
S3method(nobs, fixest)
S3method(logLik, fixest)
S3method(AIC, fixest)
S3method(BIC, fixest)
S3method(vcov, fixest)
S3method(resid, fixest)
S3method(residuals, fixest)
S3method(coef, fixest)
S3method(coefficients, fixest)
S3method(fitted, fixest)
S3method(fitted.values, fixest)
S3method(update, fixest)
S3method(predict, fixest)
S3method(confint, fixest)
S3method(formula, fixest)
S3method(model.matrix, fixest)
S3method(terms, fixest)
S3method(lag, formula)
S3method(deviance, fixest)
S3method(sigma, fixest)
S3method(weights, fixest)

# nlme method
S3method(fixef, fixest)

#
# IMPORT
#

import(dreamerr)

importFrom(numDeriv, hessian, jacobian, genD)

# needs re-export :-(, not the best solution but...
importFrom(nlme, fixef)
export(fixef)

importFrom(stats, cor, dnorm, lm, nlminb, optim,
			  pnorm, qnorm, as.formula, var, sd, formula,
			  na.omit, model.frame, "na.pass", poisson, pt)

# stats methods
importFrom(stats, model.matrix, sigma, deviance, weights, terms,
             nobs, AIC, BIC, update, predict, fitted, fitted.values,
			  resid, residuals, logLik, coef, coefficients, lag,
			  confint, vcov, binomial, setNames)

importFrom(utils, combn, head, tail)

importFrom(Formula, Formula)

importFrom(Rcpp, evalCpp)

importFrom(graphics, par, plot, box, axis, abline, points, text, title,
           lines, polygon, segments, plot.default, strwidth, strheight,
           rect)

importFrom(grDevices, rgb, col2rgb)


