import{isStreamLayer as r}from"../utilities/_layers.js";import{checkArg as e}from"../utilities/checkArg.js";import{FeatureLayer as a}from"./FeatureLayer.js";import{ERR_LAYER_TYPE_MISMATCH as i}from"./_layerHelper.js";export var StreamLayer;!function(s){async function t(s,t){e("layerJson",s).isNotMissing(),e("layerJson.layerType",s.layerType).satisfies((r=>!r||"ArcGISStreamLayer"===r),i),e("layer",t).isNotMissing().satisfies(r,i),await a.applyToEsriApiLayer(s,t)}s.toEsriApiLayer=async function(r){e("layerJson",r).isNotMissing(),e("layerJson.layerType",r.layerType).satisfies((r=>!r||"ArcGISStreamLayer"===r),i);const a=new((await import("@arcgis/core/layers/StreamLayer")).default);return await t(r,a),a},s.applyToEsriApiLayer=t,s.fromEsriApiStreamLayer=function(r){return e("layer",r).isNotMissing(),{...a.fromEsriApiFeatureLayer(r),layerType:"ArcGISStreamLayer"}}}(StreamLayer||(StreamLayer={}));