```typescript
export function drainFrames(chunks: string[], marker: string): { frames: string[]; pending: string } {
  if (marker.length !== 1) {
    throw new Error('Marker must be a single character');
  }

  const result = { frames: [], pending: '' };
  let currentFrame = '';

  for (const chunk of chunks) {
    currentFrame += chunk;

    while (currentFrame.includes(marker + marker)) {
      // Fold two consecutive markers into one literal marker
      currentFrame = currentFrame.replace(marker + marker, marker);
    }

    const lastIndex = currentFrame.lastIndexOf(marker);

    if (lastIndex !== -1) {
      // Found a lone marker, end the current frame
      result.frames.push(currentFrame.slice(0, lastIndex));
      currentFrame = currentFrame.slice(lastIndex + 1);
    }
  }

  // If there's any remaining text in currentFrame, it's part of the pending text
  if (currentFrame.length > 0) {
    result.pending = currentFrame;
  }

  return result;
}
```