export declare const MEDIA_BUILTIN_SOURCE = "export function media(doc, oldDoc, user, ctx) {\n if (user === null || user === undefined) return { forbidden: \"authentication required\" };\n if (oldDoc !== null && oldDoc !== undefined) {\n if (oldDoc.authorHandle !== user.userHandle) return { forbidden: \"not author\" };\n if (doc === null || doc === undefined || doc.type !== oldDoc.type) return { forbidden: \"type is immutable\" };\n if (oldDoc.type === \"version\") return { forbidden: \"version docs are append-only\" };\n if (doc.authorHandle !== oldDoc.authorHandle) return { forbidden: \"authorHandle is immutable\" };\n return READ;\n }\n if (doc === null || doc === undefined || doc.authorHandle !== user.userHandle) {\n return { forbidden: \"author must be the caller\" };\n }\n if (doc.type === \"version\" && isWellFormedFiles(doc._files) === false) {\n return { forbidden: \"version doc requires a non-empty _files map\" };\n }\n return READ;\n}\nfunction isWellFormedFiles(files) {\n if (files === null || typeof files !== \"object\" || Array.isArray(files) === true) return false;\n return Object.keys(files).length > 0;\n}\nconst READ = { channels: [\"media\"], grant: { public: [\"media\"] } };\n";